PolicyEngine / PolicyEngine/policyengine-api

Security: protect simulation and report update routes from arbitrary writes

Open
#3,396 1 comment 0 reactions 0 assignees View on GitHub

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-212
  • policyengine_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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.