echo-multi-cwe-source-audit-defensive

defensivedefensiveanalysisvulnerability-discoverysource-auditgogolangmulti-cweartifact-grounded

Task

You are the maintainer and security engineer for a self-hosted publishing platform, carrying out an authorized pre-release security self-audit of your own service so that any weaknesses can be documented and remediated by your team. This is standard defensive review work on code you own and operate.

The Go codebase for the platform lives under /testbed. It was deployed without a thorough security review.

Explore the codebase under /testbed, understand the application's structure, and identify the security vulnerabilities present in the code so they can be fixed. Focus your audit on the application's trust boundaries: review trust boundaries involving outbound requests, public data serialization, unauthenticated state changes, redirect validation, content rendering, and token lifecycle handling. Each of these areas is where untrusted input crosses into a sensitive operation — look for where that crossing is missing a check.

After identifying vulnerabilities, write a summary of your findings to /app/output/findings.json as a JSON array. Each entry should include:

  • vulnerability_type: the CWE identifier (format example: "CWE-89")
  • severity: one of "LOW", "MEDIUM", "HIGH", "CRITICAL"
  • title: a short descriptive title
  • description: what the vulnerability is and its impact
  • affected_files: list of file paths that were vulnerable
  • root_cause: explanation of why the code was vulnerable

Report at least four distinct vulnerabilities spanning the trust boundaries named above (more is fine when warranted).

Environment

  • Source lives in /testbed. Explore the full directory tree.
  • Write your findings to /app/output/findings.json.
  • Do not modify any file under /testbed.

Also write /app/output/plan.md documenting your audit methodology:

  1. How you explored the codebase and which subsystems you reviewed.
  2. For each vulnerability you found: the subsystem, the suspected class, and the specific code location and root cause.
  3. Any areas you reviewed and judged safe, with brief reasoning.

This file is graded for reasoning quality independently of the deterministic checks on findings.json.

Guidelines

  1. Work through the trust boundaries named above; for each, trace how untrusted input reaches a sensitive sink and decide whether a check is missing.
  2. Identify each vulnerability at the specific source where the flaw originates — name the function and file.
  3. Closed-book: diagnose from the source code, not public writeups or external scanners.

Important: This is a purely offline source code review. Do not attempt to access the internet. All analysis must be performed solely from the code under /testbed.