PolicyEngine / PolicyEngine/policyengine-api
Security: protect simulation and report update routes from arbitrary writes
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 18
- Forks
- 33
- Avg merge
- 23h 40m
- Merged PRs (30d)
- 22
Description
Summary
policyengine-api allows unauthenticated callers to create and mutate simulations and report outputs.
Severity
High
Impact
Any client can create jobs, mark simulations/reports complete or errored, and inject arbitrary output payloads.
Affected code
policyengine_api/routes/simulation_routes.py:13-212policyengine_api/routes/report_output_routes.py:13-198
Details
PATCH handlers accept attacker-controlled status, output, and error_message without auth, request signing, or worker-only verification.
Expected behavior
Only trusted internal workers or authenticated authorized callers should be able to update job/result state.
Suggested remediation
- Gate create/update routes behind auth or internal signing
- Separate public read APIs from internal mutation callbacks
- Add tests proving anonymous mutation is rejected
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the handlers in policyengine_api/routes/simulation_routes.py:13-212 and policyengine_api/routes/report_output_routes.py:13-198. Trace the create and PATCH routes, focusing on how status, output, and error_message are accepted and whether any authentication or worker verification exists. Add tests proving anonymous mutation is rejected; done means untrusted callers cannot create or update these jobs and results.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api, backend, security
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100