iam-s3-confidentiality-defensive
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 /healthreturns JSON{"status":"ok","service":"tablewriteda",...}.POST /api/credentials/vendwith a normal namespace/table (e.g.analytics/reports) returnsok: true,scopeBounded: true, andcanAccessVictim: false.GET /api/credentials/scope-check?namespace=...&table=...reportsscopeBoundedandisolationOk.GET /api/catalog/statsreports bucket and victim table metadata.- Config in
/testbed/config/storage.jsonremains 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:
- The subsystem(s) and suspected vulnerability class you identified.
- The root cause you traced.
- The fix approach and why it addresses the root cause.
- 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 on127.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
- Fix the root cause at the authorization boundary rather than applying a context-inappropriate transformation.
- Ensure every reachable credential path rejects or safely represents unsafe request values and evaluates isolation against the authorization actually vended.
- Do not remove
/api/credentials/vend, return empty policies for all tables, or hardcode a response for specific namespace/table pairs. - After patching, rebuild with Maven so the running JAR reflects changes.
- Do not add new third-party dependencies beyond the existing toolchain.