Skip to content

security(proxy,approval): PG Extended Query wire framing & replay-proof HMAC approval tokens (SEC-08) - #64

Merged
divyanshujethi merged 2 commits into
mainfrom
sec/phase7-extended-query-and-replay-guard
Nov 18, 2026
Merged

divyanshujethi merged 2 commits into
mainfrom
sec/phase7-extended-query-and-replay-guard

Conversation

@divyanshujethi

Copy link
Copy Markdown
Contributor

Phase 7 (P1) - Runtime Boundary Hardening (SEC-08)

  • Implements PostgreSQL Extended Query wire protocol framing (\Parse\ 'P', \Bind\ 'B', \Execute\ 'E') in \src/proxy/protocol.ts\ and \src/proxy/server.ts, reconstructing bound parameterized SQL ASTs before policy evaluation.
  • Adds \ReplayProofApprovalTokenManager\ (\src/approval/replay-guard.ts) binding \HMAC-SHA256(secret, requestId|normalizedSqlHash|dbId|expiresAt|nonce)\ with 10-minute TTL and single-use nonce consumption (\403 Token Already Consumed\ on replay).
  • Adds full regression coverage in \ ests/phase7-extended-query-and-replay-guard.test.ts\ (210/210 suite passing).

Comment thread src/approval/replay-guard.ts Fixed
@divyanshujethi
divyanshujethi merged commit 973f2a9 into main Nov 18, 2026
8 checks passed
@divyanshujethi
divyanshujethi deleted the sec/phase7-extended-query-and-replay-guard branch November 18, 2026 03:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants