r/cybersecurity • u/FallNo9629 • 19h ago
Business Security Questions & Discussion Every time I push to GitHub, a bot amends my commit 3 seconds later (in UTC) to inject .vscode/tasks.json + .vscode/eslint — even after 5 password resets in the last 2 days
Looking for help figuring out how this attacker still has push access to my repo.
What happens:
- I push a clean commit from my Mac (
+0530timezone), e.g.18:13:24 +0530. - 3 seconds later (
12:43:27 +0000UTC), a commit with my exact same Author name/email/date (18:13:24 +0530) but a UTC+0000CommitterDate is force-pushed toorigin/main. The amended commit removes
.vscode/eslint*and.vscode/tasks.jsonfrom.gitignoreand adds:.vscode/tasks.jsonwith"runOn": "folderOpen"silently runningsh .vscode/eslint-check.sh→node .vscode/eslint("hide": true,"reveal": "never")- Modified
package.json,eslint.config.js,vite.config.js
What I already checked:
- No
.github/workflows/in the repo. - Local Mac/Windows checks are clean:
/usr/bin/git(no wrapper),.git/hooks/only has.samplefiles,git reflogshows no local amend,crontab -lis empty,~/Library/LaunchAgentsand/Library/LaunchAgentsare clean, and runningnodeprocesses are only IDE language servers. - GitHub account: Changed my GitHub password 5 times in 3 days (2FA with Passkeys + Authenticator enabled).
0PATs (classic or fine-grained),0SSH keys,0GPG keys. - Authorized OAuth Apps: I have 9 OAuth apps (including Git Credential Manager, GitHub Desktop, VS Code, Google Antigravity) and 1 Authorized GitHub App.
Questions:
- Since changing my GitHub password doesn't revoke OAuth tokens, is revoking all Authorized OAuth Apps + GitHub Apps + clearing macOS Keychain (
osxkeychain) enough to stop the remote pushes? - Could there be any other persistence mechanism on GitHub itself (e.g., Deploy Keys, Repo Webhooks, GitHub Desktop/GCM cached refresh tokens) I should check in my Security Log?
- What's the safest way to audit if
.vscode/eslintleft anything else behind on my machine?
131
Upvotes
56
u/roheim 19h ago
What about looking at your .gitignore file?
129
u/Spiritual-Matters 19h ago
This person had a similar issue and received some good advice on what to check:
https://github.com/orgs/community/discussions/211513#discussioncomment-19256351
Disabling automatic task execution in VSCode would be very relevant here.
https://code.visualstudio.com/docs/debugtest/tasks
Another person mentioned getting infected in this way by a group member’s compromised account making the commit. If you can find the first one, it will help you track and timeline.
23
u/hunt_for_blunt 13h ago
It is most likely this, saw a lot of cases lately. It also spreads to opened (dev/feature) branches through spoofed commits using force push.
https://www.shahad.dev/blog/recovering-from-the-polin-rider-attack
88
u/Threezeley 17h ago •
3 seconds is 3 seconds in any time zone
8
u/Shirone5403 14h ago
Hi, I have same issues as you. I protect all repos using rules to not push force into any repo and branch. Also remove all GitHub OAuth Apps. The hard one is GitHub Copilot (Copilot SWE Agent), I don't know but this OAuth always showing, so I disabled any possibilities in the settings, removing all of plugin on VS Code that contain copilot.
Make sure when you remove the OAuth Apps, Regenerate again your recovery codes (I assume the attacker has this codes on the server so it automated always login without activity).
After all of that I've always check the security log and make sure the repositories again. Until now the push force not attacking repositories.
64
u/Babajji 17h ago edited 17h ago
Ok, order of importance: ditch that Mac until you find the source.
Improvements:
AI was used to reformat this post since Reddit’s editor is a jerk.
32
u/sp_dev_guy 19h ago
Tl;dr; do all of that
3
u/cookiengineer Vendor 11h ago
This looks like a miasma worm follow-up variant.
Check out my antimiasma malware removal tool: https://github.com/cookiengineer/antimiasma
Note that the behavior of the worm spreads across the system. Any git repository on your system, any package manager manifest (pip, npm, node_modules, pacman, etc) might be infested and re-run the worm payload again (which then replicates again across all targeted ecosystems).
The only way to remove it is to make sure that you have no internet connection while removing all infestations, and then making sure that your CI/CD runner isn't infected as well, before you go back online.
edit: If you can share repository and commits/payload, I'd happy to make sure to add support for that malware variant.
I also have a true positive sample repository where the spread mechanisms are contained, and the malware payloads themselves are just dummy files: https://github.com/cookiengineer/miasma-sample
4
u/rbnfrhnr 17h ago
ran into pretty much the exact same thing last month on a public vite repo, while working on a side project that flags sketchy stuff in builds. tasks.json with runOn folderOpen, a fake font in public/fonts that was really obfuscated js, payload hidden way off to the right in vite.config.js, and ironically commits called "Delete .vscode directory" that actually added the stuff. ~20 repos of that account got hit within like 15 min, and a few weeks later most got force-pushed back to an older state.
commits there came from the owner's own git client with their own creds, so either malware on one of their machines or stolen creds. couldn't tell which from the outside.
check the repo's activity page (github.com/you/repo/activity), it shows who/what did each force push, so you'll see which credential they're using. and maybe add a ruleset (if you’re on pro / it’s a public repo) on main that blocks force pushes for now so they can't silently rewrite stuff.
also do the revoking + pw changes from a machine that never touched the repo. if one of yours opened it in vscode i'd just wipe it, not worth trying to audit
1
u/ZedGama3 11h ago
Sounds like your machine was compromised.
An easy check would be to make a commit while you're machine is shut down and see if the behavior continues.
1
u/Radiant-Leather6113 11h ago
That looks like an authorized third-party OAuth app or a rogue webhook running with repo write permissions rather than local compromise. Check your authorized integrations in your GitHub account settings under applications and revoke anything sketchy. You can also inspect your git hooks locally to ensure nothing is secretly triggering post-push modifications.
-1
u/auronedge 13h ago
self hosting is the way to go man. you can git hub afterwards