PPT-2536: hostile and malformed input never 5xx or leak - #12
Merged
Conversation
PPT-2536 test-matrix SEC-01. /auth/* is internet-facing and continuously scanned — the dev nginx logs show a steady trickle of probes against /auth/authority.php, .env, .bak and friends. Those ride on a REAL route prefix, so not_found_spec.cr's unmatched-path cases don't cover them. Asserts an absolute floor across scanner suffixes, path traversal and encoding tricks, malformed token bodies (empty, unknown grant, junk JWT, oversized, array params), a wrong content-type, junk authorize queries, and garbage bearer tokens: never a 5xx, never a backtrace, never a credential in the body. Also pins the open-redirect guard — a hostile redirect_uri must never come back as a Location. Backtraces are only suppressed when SG_ENV=production, which the delivered config does NOT set (tasks/PPT-2536/config-parity), so these have to hold in development mode too. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PPT-2536 test-matrix SEC-01. Second slice of the test-suite campaign.
Why
/auth/*is internet-facing and continuously scanned. The dev nginx logs show a steady trickle of probes against/auth/authority.php,.env,.bakand friends — these ride on a real route prefix, sonot_found_spec.cr's unmatched-path cases never covered them.The bar is deliberately low and absolute: never a 5xx, never a backtrace, never a credential. A 5xx on a scanner probe is both an availability signal and an information leak.
This has to hold in development mode too: auth.cr only suppresses backtraces when
SG_ENV=production, and pertasks/PPT-2536/config-paritynothing in the delivered config actually setsSG_ENV.Coverage
.php .env .bak .json .old .txt .zip .config .aspx ~ %00 .git/config .aws/credentials)javascript:redirect_uri/auth/token/infoand/auth/userinforedirect_urimust never come back as aLocationResult
158 examples, 0 failures. Every case already passes — this pins existing good behaviour against regression rather than fixing a defect.🤖 Generated with Claude Code