-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Closed
Labels
Description
Django uses the settings DATA_UPLOAD_MAX_NUMBER_FIELDS and DATA_UPLOAD_MAX_MEMORY_SIZE to help against denial of service of large suspicious requests.
Django-Rest-Framework's parsers do not honor DATA_UPLOAD_MAX_MEMORY_SIZE setting in any way since it never uses request.body directly but instead request.read(). DATA_UPLOAD_MAX_NUMBER_FIELDS is probably not honored as well but this one is not that important.
Since the setting is not honored, a valid huge json request can cause an unhandled MemoryError on the parsers which is quite ugly.
I'm wondering if there's an easy way to honor this flag, or should we manually write/override the existing parsers to check this flag?
glmvrml, jsj14 and liampauling