I am writing an app that serves images to clients. The app is written mostly in python. I store the images in AWS s3 and serve the clients them directly from there. Am I vulnerable to buffer overflow attacks? If an image is bigger than 500KB I resize it so it would be less than 500KB. Does this prevent buffer overflow attack? Are my clients subjected to these?

  • 2
    Do you know what BO attacks are and how that vulnerability gets created? An image of 1B could trigger a BO depending on how the program is written. It's not about the data but about the buffer ...
    – schroeder
    Commented Dec 22, 2020 at 19:10
  • 2
    Or rather, it's about management of the buffer(s). Commented Dec 22, 2020 at 21:34

1 Answer 1


Python is a high-level language; it does not expose memory management to the programmer. Thus, you can't make errors when programming that lead to buffer overflows (unless any of your code is written in e.g. C/C++).

However, the cPython interpreter itself could contain buffer overflows since it is written in C, but this doesn't happen terribly often and your best defense would be to keep Python up to date in this case.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .