fix(claude-code): allow dot-prefixed segments in git-subdir paths - #34781
fix(claude-code): allow dot-prefixed segments in git-subdir paths#34781devin-ai-integration[bot] wants to merge 1 commit into
Conversation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
|
|
Greptile SummaryThis PR broadens git-subdirectory validation to accept dot-prefixed path segments while continuing to reject exact
Confidence Score: 5/5The PR appears safe to merge with no actionable regressions identified. The revised expression admits the intended dot-prefixed names while still rejecting exact
|
| Filename | Overview |
|---|---|
| litellm/proxy/anthropic_endpoints/claude_code_endpoints/claude_code_marketplace.py | Safely broadens the allowlisted path grammar to support dot-prefixed segments while preserving relative-path and traversal restrictions. |
| tests/test_litellm/proxy/anthropic_endpoints/test_claude_code_marketplace.py | Adds meaningful regression coverage for accepted hidden-directory paths and rejected exact traversal segments. |
Reviews (1): Last reviewed commit: "fix(claude-code): allow dot-prefixed seg..." | Re-trigger Greptile
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
TLDR
Problem this solves:
.claude/skills/...) are rejectedHow it solves it:
.and..traversalRelevant issues
Fixes #34778
Linear ticket
Pre-Submission checklist
@greptileaito re-request a review after pushing changes)Screenshots / Proof of Fix
Live proxy (
litellm/proxy/proxy_cli.py --config litellm/proxy/dev_config.yaml) with a local Postgres, hittingPOST /claude-code/pluginsBefore the fix (base regex, commit 48b5a5a), a dot-prefixed path is wrongly rejected
After the fix (commit 57aa811), the dot-prefixed path is accepted and traversal stays blocked
Type
🐛 Bug Fix
Changes
The old
_VALID_GIT_SUBDIR_PATH_RErequired every segment to start with[a-zA-Z0-9], so a leading dot was never accepted even though the error message advertised dots as valid. Conventional directories like.claude/(same as.git/,.github/) were unusableEach segment now allows a leading dot, and a negative lookahead
(?!\.{1,2}(?:/|$))rejects the.and..segments so path traversal, leading/, backslashes, and percent-encoded sequences remain blockedFinal Attestation
Link to Devin session: https://app.devin.ai/sessions/4c075dd8b53c4c64ae34086c00530388