AI NewsOpen sourceAnnouncement

CloneGuard scans a repo for credential stealers before you run it

A new Go tool scans a cloned repository for credential stealers before you open or run anything from it.

AI News

Editorial2 min read

LinkedInX
CloneGuard GitHub repository card showing the project name and description.

Image: GitHub

Why it mattersA take-home codebase from a stranger can read SSH keys the moment the folder opens. A scan before you touch it shrinks that risk.

A fake recruiter on a video call gave Tharun208 a take-home codebase and asked him to run it. He ran it, stopped it, and later asked an AI tool to read the code. It was a stealer going after SSH keys and AWS credentials. He reported it to his employer's IT team. Then he wrote CloneGuard.

CloneGuard is a read-only Go command-line tool. It scans a cloned project for the patterns used in that kind of attack. It runs before you open or install anything from the repo. The author posted it to Hacker News, where it reached 28 points. The GitHub repository shows 14 stars, with the first commit four days ago.

What it looks for

The README lists the rule classes. The tool flags code that reads SSH keys. It flags code that reads cloud credentials for AWS, GCP, Azure, Kubernetes, Docker, npm and Git. It also flags shell history reads, browser password reads, and wallet reads. It flags network calls to raw IP addresses, webhook endpoints, pastebin services, and public tunnel services. It flags the download-and-run patterns eval, new Function, and curl | sh. It flags auto-run hooks such as npm install scripts. It flags .vscode/tasks.json tasks that fire when a folder is opened.

A file that both reads secrets and talks to a suspicious server is escalated to a critical finding. The tool exits with code 0 for clean, 1 for caution, 2 for suspicious, and 3 for dangerous. A team can drop it into a git hook or a CI step with a one-line check.

What it does not look for

The author says so in plain words: the rules look for known shapes of code, not every possible one. A determined attacker can hide code that CloneGuard misses. A password manager or similar legitimate tool can set off false positives. A clean scan still leaves real risk. For code from strangers, the README tells readers to use a throwaway virtual machine as well.

Why the pattern matters

In the attack the author describes, an install hook did the harm. It ran before he read a line of the stated feature. An npm install script or an editor task can run the moment you open the folder. That is also the pattern several package-registry attacks used in 2026.

A reader whose job includes running code from strangers can add this scan between clone and open. That includes candidates, open-source contributors, and forum posters. It is one binary with no network calls of its own. It runs before any install hook or editor task can.

Source

SourceGitHub

This item was written by an AI system from the linked source. Reveneau is responsible for what it publishes.

Share
LinkedInX
Start a project