Skip to content

fix: authenticate TURN responses before transaction completion - #156

Merged
the-sarge merged 2 commits into
mainfrom
codex/authenticate-turn-responses
Oct 19, 2026
Merged

the-sarge merged 2 commits into
mainfrom
codex/authenticate-turn-responses

Conversation

@the-sarge

@the-sarge the-sarge commented Oct 19, 2026 •

Copy link
Copy Markdown
Owner

TURN responses could retire a live transaction using only its ID, allowing a same-source injected response to alter allocation or peer readiness state. Bind each transaction to its request method and response key, verify MESSAGE-INTEGRITY before completion, and leave rejected packets live for a later genuine response.

The initial Allocate exchange accepts only a well-formed 401 challenge. Authenticated 438 responses require a signature, matching realm, and nonempty nonce; attributes after MESSAGE-INTEGRITY are hidden from consumers. Update turntest and scripted responses to sign authenticated exchanges. Servers that omit signatures on responses to authenticated requests will now time out. Wrong-password 401 responses can also exhaust retries and return ErrTransactionTimeout instead of a 401 TurnError, even when the server supports signing.

Validation: task preflight and focused security regressions passed on 967a4c7. RAS review 20261019T011410-09b300be8de82c81029cb01f identified two documentation corrections, which are included; no runtime fix was required by review. A successful post-ready ci-required check on the same head is required before merge.

ID-only completion let forged responses retire authenticated work before any method or integrity check. Bind each transaction to its request method and response key, validate challenges, and hide attributes outside the HMAC before publication. Sign authenticated fixture responses and cover forged Allocate, Refresh, CreatePermission, and ChannelBind responses.

Validation: task verify; task race; focused security and transaction regressions repeated three times.
@the-sarge
the-sarge marked this pull request as ready for review October 19, 2026 01:39
@the-sarge
the-sarge merged commit 6cbd5c0 into main Oct 19, 2026
2 checks passed
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.

1 participant