Repository navigation
[SECURITY] Stacked meta-PR: AR SQLi, CRLF headers, open redirect, cookies, CSRF - #24
Closed
thomasklemm wants to merge 2 commits into
Closed
thomasklemm wants to merge 2 commits into
thomasklemm wants to merge 2 commits into
Conversation
…on CRLF Co-authored-by: Thomas Klemm <github@tklemm.eu>
Fold rubys#459 (limit/offset/hash order as values) plus string order parsed as col/table.col with ASC/DESC, and validate last_n/first_n before mutating. Fold rubys#464 positional where/having binds as a one-pass split so ? and backslashes in values stay data. Sanitize head/render locations and headers[]= with a shared HeaderStore (Puma drop). Share one HttpHeaders helper for Tep/CGI. Escape CR/LF/NUL in URL filename components; re-allowlist disk disposition at show. redirect_to refuses an absolute URL whose host is not this request's Host. Session/flash cookies get SameSite=Lax and Secure on HTTPS; signed jar options are honored. HMAC-only session store remains a named residual (no AES-GCM in this runtime). CSRF: verify_authenticity_token on shared Base, implicit protect_from_forgery on, empty session token matches nothing. Closes #23. Overlay/spinel still mint per-session tokens. Pin with emit_and_run overlays. Skip ActionText XSS, LIKE, path decode, Tep parser PRs, and Campfire app patches. Co-authored-by: Thomas Klemm <github@tklemm.eu>
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Comment |
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.
Stacked compiler/runtime security meta-PR. Includes #459 (limit/offset/hash
order), #461 (CRLF Location / disposition / Tep+CGI drop), and #464 (positionalwhere/havingbinds). Extra commits on top. Roundhouse only (runtime/ruby, lowerer, Spinel glue). No Campfire/base-app patches.Closes #23.
Landed
limit/offsetas integers; hashorderallowlist; stringorderparsed ascol/table.colplus optional ASC/DESC;last_n/first_nvalidate before mutating.redirect_to,head, andrender;headers[]=drops illegal lines (HeaderStore); blob filename CR/LF/NUL percent-encoded; diskshowre-allowlists disposition; oneHttpHeadershelper for Tep and CGI (not Tep-only).?binds split once so question marks and backslashes in values stay data.redirect_torefuses an absolute URL whose host is not this request’sHost(coversparams[:back]and a storedrequest.urlafter a spoofedHTTP_HOST).httponly:/same_site:/secure:; session and flash cookies getSameSite=LaxandSecureon HTTPS. HMAC-only session store is still a named residual (no AES-GCM CookieStore here).verify_authenticity_tokenon sharedActionController::Base; implicitprotect_from_forgeryon; empty session token matches nothing. Ruby/Spinel overlays still mint per-session tokens. Tests keepallow_forgery_protection = false.Pinned with
tests/emit_and_run.rsoverlays plustests/param_binds.rs/ existing Spinel header and cookie tests.Skipped (own PRs / out of scope)
html_escapewrap, unverified mention SGIDResidual risk
joins(String)fragments andupdate_all("sql")strings stay trusted developer SQL (Rails-same). Identifier quoting is still regex allowlist, notquote_column_name.return_tofrom the cookie on cleartext HTTP; flags mitigate the cookie jar, not payload confidentiality.Current.controllerstill render an empty token; implicit verify then fail-closes mutating requests. Ruby/Spinel Campfire is the proven pair.emit_and_runoverlays remain#[ignore](toolchain).No
/thermosreview on this PR.