Skip to content

credential broker: refuse percent-encoded parent traversal - #198

Merged
ReganBell merged 1 commit into
mainfrom
upstream-broker-path-traversal
Aug 4, 2026
Merged

credential broker: refuse percent-encoded parent traversal#198
ReganBell merged 1 commit into
mainfrom
upstream-broker-path-traversal

Conversation

@ReganBell

@ReganBell ReganBell commented Aug 4, 2026

Copy link
Copy Markdown
Collaborator

Fixes the git-broker finding from #125; reported in #154. The path allowlist checked literal ../ but not percent-encoded forms (single or double). Decode before checking, reject decoded parent traversals, same guard on the git smart-HTTP route. Tests cover both routes, plain/single/double-encoded. Co-authored with the #154 reporter.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

The broker's path allowlist checked literal "../" but not its
percent-encoded forms, so an allowed prefix could be escaped with
%2e%2e%2f (single- or double-encoded). Decode before checking, reject
any path whose decoded form contains a parent traversal, and cover the
git smart-HTTP route with the same guard. Regression tests exercise
both routes with plain, single-, and double-encoded traversals.

Reported in #154 (closes the #125 git-broker finding).

Co-authored-by: yassine-ceo <yassine-ceo@users.noreply.github.com>
@ReganBell
ReganBell merged commit ee7344b into main Aug 4, 2026
20 checks passed
@ReganBell
ReganBell deleted the upstream-broker-path-traversal branch August 4, 2026 19:13
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