Miserlou / Zappa

Serverless Python
https://blog.zappa.io/
MIT License
11.89k stars 1.2k forks source link

Zappa returning stack traces in response body when Unicode characters used in URI #1170

Closed majackson closed 6 years ago

majackson commented 6 years ago

Context

A company I am currently working at recently hired a penetration tester to an investigate a REST API built with python3, django and zappa.

A redacted extract from the security report is below: zappa_django_pentest

From the stack trace given in the response, I am not certain if the problem lies with django or zappa, so some insight from others here would be useful.

It's important not to return stack traces in responses, as it reveals the internals of a system, which could lead to the exploitation of vulnerabilities.

Environment

mcrowson commented 6 years ago

So one of the settings in the config file is "debug" which defaults to true. When this value is true, it returns errors in the response. When it is set to false, you get a wonderfully cryptic 500. Do you know what that zappa_settings.json looks like?

majackson commented 6 years ago

d'oh! This simple solution fixed the issue. It does seem a shame that the non-debug error-handling response discloses that Zappa is the tool being used though. Thanks for your help!