Skip to content

Drop .hg/hgrc from uploaded project zips - #2756

Merged
myieye merged 3 commits into
developfrom
claude/drop-uploaded-hgrc
Oct 19, 2026
Merged

myieye merged 3 commits into
developfrom
claude/drop-uploaded-hgrc

Conversation

@myieye

@myieye myieye commented Oct 14, 2026

Copy link
Copy Markdown
Collaborator

[Claude, autonomous]

An uploaded zip's .hg/hgrc became trusted server config, so its hooks and extensions would run whenever hg touched the repo. Nothing server-side needs a repo-level hgrc: Lexbox-created repos have none, hgweb is configured globally, hgresumable never reads one, and hgrc doesn't travel with clone/push/pull. So the reset upload now drops it. Upload is admin-only, so this is defense in depth.

🤖 Generated with Claude Code

An uploaded zip keeps its whole .hg folder, so its hgrc became the server
repo's config, owned by the server user and therefore trusted by Mercurial:
hooks and extensions in it would run whenever hgweb, the command runner or a
maintenance script touches the repo. Nothing on the server needs a repo-level
hgrc (Lexbox-created repos don't have one, hgweb is configured globally, and
hgrc never travels with clone/push/pull), so drop it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions github-actions Bot added the 📦 Lexbox issues related to any server side code, fw-headless included label Oct 14, 2026
@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 26 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: cf454fc3-8723-4f05-aeb1-d4a725d99070
📥 Commits

Reviewing files that changed from the base of the PR and between 6abcb76 and c74c5be.

📒 Files selected for processing: 2
  • backend/LexBoxApi/Services/HgService.cs
  • backend/Testing/LexCore/Services/HgServiceTests.cs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

myieye and others added 2 commits October 14, 2026 16:49
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Same behaviour, but the file is found by walking the upload instead of by a
path built from the project code, which CodeQL flagged as path injection.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@myieye myieye changed the title [claude] Drop .hg/hgrc from uploaded project zips Drop .hg/hgrc from uploaded project zips Oct 19, 2026
@myieye
myieye merged commit 1798ea1 into develop Oct 19, 2026
12 checks passed
@myieye
myieye deleted the claude/drop-uploaded-hgrc branch October 19, 2026 08:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

📦 Lexbox issues related to any server side code, fw-headless included

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants