Repository navigation
fix: deny dot path segments in all three (#70) - #81
Merged
Merged
Conversation
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.
Description
Closes #70.
The router let exec and attach paths hide behind dot segments. In
GET /./exec/<id>/jsonorGET /x/../exec/<id>/jsonthe first segment is.orx, so the exec check missed it and the read passthrough forwarded it;POST /containers/x/./startwas even routed as a container start. The daemon answers dot-segment paths with a301to the clean path, so nothing leaked, but the router allowed paths it should deny and relied on daemon behaviour the proxy does not control.What changes
.or.., for every method, withdot path segment not allowed. The check sits right after the//check (Deferred minor findings from the #43/#47/#50/#51 review cycles #55) and before the API-version strip, on the path without its query. Names such as.hidden,a.band...are unaffected;%2eis already denied by the%check (Percent-encoded container names: Go routes on the decoded path, Rust/TS on the raw path #53);--readonlystill runs first.//check.spec/router.qnt):.and..joinWORDS; flagALLOW_DOT_SEGMENTS; the rule-level propertydotSegmentsDeniedand the security propertydotSegmentsHideNoExec(a path that is an exec or attach path once its dot segments are resolved is denied; it mentions neither the rule nor the flag); rows; androuter_pre70, which witnesses both the exec and the attach halves of the old gap.curl --path-as-is.spec/README.md, AGENTS.md counts.Review notes
bump=patch tag=v0.3.11.make test-spec.Verification
routerwithALLOW_DOT_SEGMENTS = truefailsdotSoundTestand the threedot*rows;router_pre70asserts both properties fail and thatGET /./exec/abcandGET /./containers/attachwere allowed.6523ea9), the same 8 deny rows fail in Go, Rust and TS; the new integration checks on the pre-fix Go code:make test-allGo 113, Rust 145, TS 164 (1 skipped);make lint-all,make test-spec(10 runs),make verifypass; integrationALL 63 TESTS PASSEDfor Go, Rust and TS; socket suiteALL 15 TESTS PASSED.Type of change
Implementation(s) changed
Testing
make test-all)make verify,make test-spec)Checklist