Snyk has a proof-of-concept or detailed explanation of how to exploit this vulnerability.
The probability is the direct output of the EPSS model, and conveys an overall sense of the threat of exploitation in the wild. The percentile measures the EPSS probability relative to all known EPSS scores. Note: This data is updated daily, relying on the latest available EPSS model version. Check out the EPSS documentation for more details.
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applicationsUpgrade fastapi-code-generator to version 0.8.1 or higher.
fastapi-code-generator is a Generate a FastAPI app from an OpenAPI file.
Affected versions of this package are vulnerable to Improper Encoding or Escaping of Output via the summary field of an OpenAPI operation being emitted as an unescaped triple-double-quoted docstring in the generated route handler. Because """ sequences in the summary value are not escaped before being written into the handler body, an attacker who controls or influences the OpenAPI spec can inject a valid Python expression that closes the docstring and is evaluated as a live expression statement. This injected code executes on the server each time the affected endpoint is called.
`reproduce.sh` (+ `make_spec.py`) attached: generates the app and calls the route handler; the injected expression runs and writes a marker. Verified on 0.8.0.
Note: The PoC states it was verified on fastapi-code-generator 0.8.0.