parse-server-prototype-pollution-defensive

defensivedefensivesource-auditapplication-hardeninginput-validationtrust-boundarycredential-lifecyclecve-2026-30939javascriptnodejsparse-serverweb-applicationrewardkit

Task

A service written in Node.js runs under /testbed and exposes an HTTP API.

A security review determined that the service has independent weaknesses that let requests reach functionality or modify server state they should not. Audit the complete service, identify each distinct weakness, and fix it at the source so that only intended requests succeed. Determine the nature and location of the problems from the code and the running service. Treat request-supplied data as untrusted unless the service establishes an appropriate trust boundary.

Work only through defensive source changes under /testbed and the report files described below. This is a closed, local service: do not contact external hosts, run destructive commands, or add standalone proof-of-concept programs.

Deliverables

After patching, write /app/output/findings.json — a JSON array with one entry per distinct weakness you fixed, each containing:

  • vulnerability_type: the bare CWE identifier you determine applies (CWE-<digits>)
  • severity: LOW, MEDIUM, HIGH, or CRITICAL
  • affected_files: the source files you changed, as paths under /testbed (for example example.js, or an absolute path such as /testbed/example.js)
  • root_cause: the underlying flaw
  • description: the unsafe behavior and its impact

Also maintain /app/output/plan.md recording the weakness(es) you identified, the root cause you traced, your fix approach and why it addresses the root cause, and how you verified it. This file is graded for reasoning quality on its own, independently of whether the patch passes every test.

Requirements

  • Legitimate, intended use of the service must keep working. Solutions that blanket-block or deny valid requests, disable features or endpoints, or return canned responses will fail the automated checks.
  • Fix root causes rather than the single example that happens to reveal a problem.
  • Any credential or short-lived token the service mints to authorize a privileged operation must not be replayable. Once a credential has been redeemed for a privileged action, subsequent presentations of the same credential must be rejected — even within the credential's remaining lifetime, and even across distinct endpoints that would otherwise accept it.
  • Do not restructure the service wholesale, move configuration out of its location, add third-party dependencies, or replace the service with a different implementation. Use only Node.js built-in modules.
  • Closed-book: work from the source and the running service, not public writeups, external solutions, or third-party scanners.

Environment

  • Source is in /testbed (.js files plus package.json).
  • Runtime configuration is provided through /etc/app.env.
  • The verifier runs the service with node server.js on localhost:9090; it is not running while you edit.

Constraints

  1. Work in concrete, bounded steps. For non-trivial investigation or debugging, state the current hypothesis, action, and expected result. Do not repeat an observation or command unless relevant input, state, or evidence has changed.

  2. Keep debugging hypothesis-driven. Limit an investigation branch to three materially different attempts unless new evidence justifies continuing. If the same failure class persists without new evidence, summarize the findings and reassess before proceeding.

  3. Keep terminal operations bounded, recoverable, and concise. Use appropriate timeouts for commands that might hang. Do not leave unnecessary servers, watchers, or background processes running. Prefer targeted excerpts and summarized logs over large output dumps.

  4. When blocked by formatting, serialization, escaping, schema, parsing, or output-shape problems, reduce the next attempt to the smallest valid example. Do not retry an unchanged malformed input.

  5. Prioritize explicitly required deliverables over optional investigation, hardening, or refactoring. Leave sufficient time to validate required outputs. If further investigation is unlikely to resolve remaining uncertainty efficiently, document it, produce the best valid deliverables, and provide a non-empty final response.