spec: Astra round 3 findings on video conversion, unedited
Two P1 (Lambda environment reuse lets a compromised codec reach the Runtime API; execution-role credentials and DNS exfiltration), two P2; verdict revise. Budget exhausted; goes to Paul.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
docs/superpowers/specs/CODEX-FINDINGS-VIDEO-R3.md+54 −0
CI passed — run details
Intent
<task-notification> <task-id>b2ktkzvc3</task-id> <tool-use-id>toolu_01FpkqFXqvJMtWEec4kiZ1Uh</tool-use-id> <output-file>/home/paulca/.cache/tmp/claude-1001/-home-paulca-amadan-net-carlos-platform/8509ad95-d983-414c-9679-b3ef222618ef/tasks/b2ktkzvc3.output</output-file> <status>completed</status> <summary>Background command "Run Astra round 3 review" completed (exit code 0)</summary> </task-notification>
Attributed to this commit: 9.47 g CO₂e (981,309 tokens). This is an attribution, not a measurement — usage counted from this commit's own marker forward to the next one on design-video-conversion, never backward from it. A turn that produced more than one commit books all of its tokens to the last one, and a concurrent session on this branch can add to the same figure. Some of it was priced using the shared default rate, because no model-specific factor row exists yet for at least one model involved. The Carbon view has the repo total, which is never derived from this attribution.
diff --git a/docs/superpowers/specs/CODEX-FINDINGS-VIDEO-R3.md b/docs/superpowers/specs/CODEX-FINDINGS-VIDEO-R3.md| new file mode 100644 |
| index 000000000..e96c35dc6 |
| --- /dev/null |
| +++ b/docs/superpowers/specs/CODEX-FINDINGS-VIDEO-R3.md |
| @@ -0,0 +1,54 @@ |
| +Reviewed revision 3 at `fa76108a`, round **3 of 3**. The worktree’s design matches that commit. No files were modified. This was a design review; no live Lambda tests were run. |
| + |
| +| Round-2 finding | Disposition | |
| +|---|---| |
| +| R2-1: unsafe execution-slot reuse | **Not closed:** the replacement Lambda isolation mechanism has the gap below. | |
| +| R2-2: stranded jobs | Closed at design level: the row supplies queue discovery. | |
| +| R2-3: deletion erases accounting | Closed: retirement retains rows through settlement and cleanup. | |
| +| R2-4: cancellation undercounts execution | Closed: cancellation is cut; uncertain execution is charged the full timeout. | |
| +| R2-5: cleanup loses its schedule | Closed: `cleanup_due` remains discoverable until cleared. | |
| +| R2-6: bucket name mistaken for provenance | Closed at design level: recorded creation or explicit verification is required. | |
| + |
| +1. **P1 — §§5.5, 6: the compromised child can bypass the single-use runtime protocol.** |
| + **Invariant: one execution cannot acquire another execution’s input or transfer authority.** |
| + |
| + The [isolation mechanism](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-video-conversion/docs/superpowers/specs/2026-11-16-video-conversion-design.md:314) depends on the handler exiting and the next handler checking processes and clearing scratch. But the [threat model](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-video-conversion/docs/superpowers/specs/2026-11-16-video-conversion-design.md:438) gives compromised ffmpeg the handler’s user identity and access to its memory, while blocking sockets and process access remains optional. |
| + |
| + Lambda’s local Runtime API accepts invocation responses and supplies the next invocation. Its address is available inside the environment. **The security consequence is an inference:** a malicious child can interfere with the same-user handler and speak that protocol itself, rather than cooperate with its exit-and-cleanup sequence. The proposed startup check is not an independent enforcement boundary. [https://docs.aws.amazon.com/lambda/latest/dg/runtimes-api.html](https://docs.aws.amazon.com/lambda/latest/dg/runtimes-api.html) |
| + |
| + A runtime restart also does not itself establish a fresh microVM: AWS documents preserved `/tmp` contents across resets and resumed background processes on environment reuse. [https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtime-environment.html](https://docs.aws.amazon.com/lambda/latest/dg/lambda-runtime-environment.html) |
| + |
| + **Smallest fix:** Make isolation of both codec processes from the Runtime API, handler memory, credentials and handler-directed signals mandatory. If Lambda cannot enforce that boundary, refuse conversion before starting either codec. Extend the spike to attempt runtime-protocol takeover; leaving a background process and a scratch file is insufficient. |
| + |
| +2. **P1 — §§5.5, 6: the function has AWS credentials and an unblocked DNS exfiltration path.** |
| + **Invariant: compromising a codec grants no platform authority beyond that job’s transfers.** |
| + |
| + The [module grants network-interface management](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-video-conversion/docs/superpowers/specs/2026-11-16-video-conversion-design.md:299), while §6 claims the compromised child has no credentials and no internet route. |
| + |
| + Lambda supplies execution-role credentials through environment variables. AWS explicitly warns that the network-interface permissions granted to Lambda are also available to function code. These are separate from the conversion-role credentials that correctly remain in the console. [https://docs.aws.amazon.com/lambda/latest/dg/permissions-source-function-arn.html](https://docs.aws.amazon.com/lambda/latest/dg/permissions-source-function-arn.html) [https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html](https://docs.aws.amazon.com/lambda/latest/dg/configuration-vpc.html) |
| + |
| + An S3-only security group does not close the escape path: security groups cannot block queries to the VPC’s Route 53 Resolver. A compromised process can encode credentials in queries to an attacker-controlled domain. Once leaked, using those credentials outside the function bypasses its S3 endpoint policy. This attack chain is inferred from the documented permissions and network behavior. [https://docs.aws.amazon.com/vpc/latest/userguide/security-group-rules.html](https://docs.aws.amazon.com/vpc/latest/userguide/security-group-rules.html) |
| + |
| + **Smallest fix:** Require the codec boundary in finding 1, explicitly deny function-code use of network-interface APIs using AWS’s documented `lambda:SourceFunctionArn` restriction, and enforce a DNS policy that blocks external queries except the required store names. Keep conversion disabled until the spike proves credential isolation and DNS refusal. |
| + |
| +3. **P2 — §§5.3, 7.2: lost executions release database concurrency before Lambda releases its slots.** |
| + **Invariant: dispatch capacity includes executions that may still be consuming it.** |
| + |
| + The [lost transition](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-video-conversion/docs/superpowers/specs/2026-11-16-video-conversion-design.md:224) immediately changes running rows to failed on console startup or a transport error. However, the remote invocations can continue until timeout. The [concurrency rule](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-video-conversion/docs/superpowers/specs/2026-11-16-video-conversion-design.md:472) assumes the pass’s running count prevents throttling. |
| + |
| + With four invocations active, restart the console. All four rows become failed, so the pass admits replacements while Lambda’s four slots remain occupied. Those replacements can be throttled; the specified service-error handling then permanently fails them and charges the full timeout despite no execution. Repeating this can drain queued work and account allowances. |
| + |
| + **Fix:** Retain a concurrency reservation for uncertain invocations until their conservative latest completion time, independently of terminal state and accounting settlement. Keep that reservation in the same row. Add restart and lost-response simulations with the fake engine continuing to occupy its slots. |
| + |
| +4. **P2 — §§5.2–5.3: store destruction no longer retires conversion state.** |
| + **Invariant: jobs and results belong to the store lifetime that authorized them.** |
| + |
| + [Retirement covers app purge and account deletion only](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-video-conversion/docs/superpowers/specs/2026-11-16-video-conversion-design.md:234). Yet [the existing store-destroy door](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-video-conversion/internal/console/appsettings.go:1629) destroys the store while preserving the app. |
| + |
| + A completed conversion therefore survives destruction of its outputs. Recreate the store and upload identical bytes under the same key: the [idempotency rule](/home/paulca/amadan.net/carlos/platform/.claude/worktrees/design-video-conversion/docs/superpowers/specs/2026-11-16-video-conversion-design.md:170) returns the old `done` row and nonexistent output keys. For running work, deleting the store user does not revoke the separate conversion-role transfers. Revision 2 explicitly refused commits after store replacement; revision 3 drops that rule. |
| + |
| + **Fix:** Include store teardown in lifecycle retirement, preserving accounting and cleanup. Serialize it against admission and dispatch, refuse destructive teardown while outstanding conversion authority can still write, and distinguish the replacement store’s jobs from retired rows. Add destroy/recreate interleavings to the simulation. |
| + |
| +The three-round budget is exhausted. For the P1s, I recommend **refusing conversion unless the mandatory codec boundary can be established on Lambda**, preserving R-L and R-C. No fourth review round is implied. |
| + |
| +**Verdict: revise.** |
| \ No newline at end of file |