Skip to content

fix: deny dot path segments in all three (#70) - #81

Merged
abienkowski merged 4 commits into
mainfrom
fix/deny-dot-segments-70
Oct 12, 2026
Merged

abienkowski merged 4 commits into
mainfrom
fix/deny-dot-segments-70

Conversation

@abienkowski

Copy link
Copy Markdown
Collaborator

Description

Closes #70.

The router let exec and attach paths hide behind dot segments. In GET /./exec/<id>/json or GET /x/../exec/<id>/json the first segment is . or x, so the exec check missed it and the read passthrough forwarded it; POST /containers/x/./start was even routed as a container start. The daemon answers dot-segment paths with a 301 to 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

Review notes

  • Release: merging cuts v0.3.11 (patch). Simulated squash: bump=patch tag=v0.3.11.
  • The extra model words add about 3–4 s to make test-spec.

Verification

  • Spec mutation: router with ALLOW_DOT_SEGMENTS = true fails dotSoundTest and the three dot* rows; router_pre70 asserts both properties fail and that GET /./exec/abc and GET /./containers/attach were allowed.
  • Before the fix (6523ea9), the same 8 deny rows fail in Go, Rust and TS; the new integration checks on the pre-fix Go code:
    FAIL: GET /./exec/*/json -> 403 (dot segment) (expected 403 with "dot path segment not allowed", got 301: )
    FAIL: GET /x/../exec/*/json -> 403 (dot segment) (expected 403 with "dot path segment not allowed", got 301: )
    FAIL: GET /containers/./json -> 403 (dot segment) (expected 403 with "dot path segment not allowed", got 301: )
    60 PASSED, 3 FAILED
    
  • This branch: make test-all Go 113, Rust 145, TS 164 (1 skipped); make lint-all, make test-spec (10 runs), make verify pass; integration ALL 63 TESTS PASSED for Go, Rust and TS; socket suite ALL 15 TESTS PASSED.

Type of change

  • Bug fix
  • New feature
  • Breaking change
  • Documentation update

Implementation(s) changed

  • Go
  • Rust
  • TypeScript
  • Quint specification
  • CI / infrastructure

Testing

  • Unit tests pass (make test-all)
  • Integration tests pass (63 per implementation; socket suite 15)
  • Quint verification passes (make verify, make test-spec)
  • New tests added for the change

Checklist

  • I have read CONTRIBUTING.md
  • My code follows the project's coding style
  • I have updated documentation as needed

@abienkowski abienkowski added Priority: P2 Added to issues and PRs relating to a medium severity bugs. Type: Bug Added to issues and PRs if they are addressing a bug labels Oct 12, 2026
@abienkowski
abienkowski merged commit 3130b0a into main Oct 12, 2026
7 checks passed
@abienkowski
abienkowski deleted the fix/deny-dot-segments-70 branch October 12, 2026 20:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority: P2 Added to issues and PRs relating to a medium severity bugs. Type: Bug Added to issues and PRs if they are addressing a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Router allows exec paths hidden behind dot segments (/./exec, /x/../exec)

1 participant