New rule: detect git remote set-url / git remote add (remote hijacking)
Open
Nobody has claimed this yet.
enhancement
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
Context
From Piccirello's review on PR #13 — if someone changes where origin points with git remote set-url origin <evil-url>, then a normal git push origin silently sends code to the attacker.
What to catch
git remote set-url origin <url>git remote add origin <url>(or any remote name).git/configmodifications that change remote URLs
Considerations
- Changing a remote URL is sometimes legitimate (switching from HTTPS to SSH, updating a fork URL).
- Severity should probably be
high+warnsince there are legit use cases, but it's a real exfil vector. - Related to the existing
exfiltration_git_push_non_originrule — could be a new pattern in that rule or a standalone.
Origin
PR #13 review comment by @Piccirello
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the existing exfiltration_git_push_non_origin rule and the context from PR #13. Trace how command patterns and .git/config changes are represented, then define tests for git remote set-url, git remote add, and remote URL modifications; done means these cases are detected without treating ordinary remote changes as unconditionally malicious.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, typescript
- Domain
- security
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100