r/github • u/FallNo9629 • 4h ago
Question 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 alst 2 days
/r/developersIndia/comments/1ycevow/every_time_i_push_to_github_a_bot_amends_my/
1
Upvotes
1
u/Liberation-Front 1h ago
.gitignore have a look on it.
1
u/Plastic-Bid-3431 1h ago
The thing to rule out first: this may not be an "attacker with an account" problem at all. A force-push three seconds after yours, with your author name/email and a different committer date, is what a local hook, a credential helper, a
post-commit/pre-pushhook or a script with a stored token looks like. Five password resets change the web login path, not a deploy key, a personal access token from months ago, an OAuth app grant, or a machine where a "push to main" job runs on a timer. Check the security log at github.com/settings/security-log: it records pushes with the actor and the credential type (password, token name, deploy key) and IP. The push you did not make will be there with the credential that made it. That tells you whether to rotate a token or start reinstalling a machine. Then look at Auth tokens and Applications, revoke what you do not recognise, and check repo and org webhooks. Also check whether anyone else has push access to the repo at all, including a colleague's machine. On the injected file: for VS Code, a workspace task with"runOn": "folderOpen"(documented in the tasks appendix) runs on open, andpresentation.reveal: neverplushide: truekeeps it quiet.runOn: folderOpenis the dangerous part, not the file itself. .gitignore is not a fix here: it hides the file, but CI, a container or anyone else's checkout still sees it. Add.vscode/and this path in particular to a pre-receive check or CI check that fails on unexpected task files, and change tokens before you spend more time on the working tree.