iam-s3-confidentiality-defensive

defensivedefensivesource-auditapplication-hardeningjavaiams3confidentialityrewardkit

Task

TableWriteDA is a small Java service that vends temporary S3 delegated credentials for Iceberg-style table storage paths, similar to Apache Polaris' AWS credential path. Source lives under /testbed/.

Audit the source and runtime behaviour, then patch the security issue in the table credential-vending authorization boundary. Derive the exact root cause and fix from this codebase.

Trace every path where request-derived values influence delegated storage access; alternate and legacy credential paths must enforce the same authorization boundary as the primary path.

Preserve normal behaviour:

  • GET /health returns JSON {"status":"ok","service":"tablewriteda",...}.
  • POST /api/credentials/vend with a normal namespace/table (e.g. analytics/reports) returns ok: true, scopeBounded: true, and canAccessVictim: false.
  • GET /api/credentials/scope-check?namespace=...&table=... reports scopeBounded and isolationOk.
  • GET /api/catalog/stats reports bucket and victim table metadata.
  • Config in /testbed/config/storage.json remains meaningful for isolation checks.
  • Do not disable /api/credentials/vend, reject every table name, or block only the exact verifier inputs.

Before and as you work, maintain /app/output/plan.md recording:

  1. The subsystem(s) and suspected vulnerability class you identified.
  2. The root cause you traced.
  3. The fix approach and why it addresses the root cause.
  4. How you verified the fix.

Write /app/output/findings.json as a JSON array with at least one object containing: component, cwe (a valid CWE identifier), severity, files (array), root_cause, attack_vector, impact. Describe the vulnerable authorization mechanism and its cross-table confidentiality impact. The verifier checks that findings follow this schema and accurately describe the issue.

Environment

  • Source in /testbed/ (Maven Java 21 project, service on 127.0.0.1:8096).
  • Config: /testbed/config/storage.json.
  • Build: mvn -q -DskipTests package -f /testbed/pom.xml
  • Binary: java -jar /testbed/target/tablewriteda-1.0.0.jar
  • Verifier Python 3.13 + RewardKit pre-installed.
  • Verifier rebuilds, starts the service, runs pytest, then tears down.
  • Verifier invocation: bash tests/test.sh.

Guidelines

  1. Fix the root cause at the authorization boundary rather than applying a context-inappropriate transformation.
  2. Ensure every reachable credential path rejects or safely represents unsafe request values and evaluates isolation against the authorization actually vended.
  3. Do not remove /api/credentials/vend, return empty policies for all tables, or hardcode a response for specific namespace/table pairs.
  4. After patching, rebuild with Maven so the running JAR reflects changes.
  5. Do not add new third-party dependencies beyond the existing toolchain.