Opening a repository was long considered a harmless action. You clone the code, look at what's inside, and only then decide whether to run it. That very separation is currently dissolving. According to its own statements, the security company JFrog has discovered malicious code in 42 GitHub repositories that starts automatically – among other things through AI assistants or in the course of normal work on a project. The repositories were hijacked for a worm campaign in the npm environment, i.e. in the package ecosystem of the JavaScript world.

The alarming thing about this is less the number than the trigger. It no longer takes a careless developer deliberately invoking a suspicious script. It is enough for a toolchain in the background to do what it was built for.

Why AI assistants make the difference

AI coding assistants – i.e. tools that suggest code in the editor, analyse projects or work through tasks independently – do not just read source code. Many of them evaluate configuration files, install dependencies, execute build steps or start tests in order to understand the context of a project. The more autonomously an assistant works, the more actions run without a separate prompt.

This turns the project file itself into an attack vector. Anyone who places malicious code so that it runs during an automated setup step no longer has to persuade anyone to click something. The attack exploits the convenience that makes the assistant useful in the first place.

There is also a second effect: developers often only examine repositories thoroughly once the code is actually adopted into a product. A look into a foreign project for research, comparison or as a template is considered uncritical. It is precisely in this in-between space that a campaign relying on automatic execution takes effect.

Disguise as the actual problem

Well-hidden malicious code is hard to find because it nests in places that are rarely the focus during review. Nobody reads build configurations with the same attention as the business logic. Minified or generated files are often skimmed over in pull requests. And a hijacked repository appears trustworthy as long as name, history and environment look unchanged.

The worm component makes this worse: when compromised environments in turn harvest credentials and infect further projects or packages, the number of affected locations grows without attackers having to control every step individually. Supply-chain attacks – i.e. attacks via the supply chain of libraries, packages and tools – thus scale on their own.

What development teams should concretely change

The consequence is not a return to manual work, but a clearer separation of environments and permissions. The following points can be implemented in most teams without major restructuring:

  • Open foreign code in isolation. Unknown repositories belong in a sealed-off environment, such as a container or a virtual machine without access to production credentials.
  • Configure automatic execution deliberately. Check which actions your editors, extensions and AI assistants may perform without a prompt – especially installing dependencies and starting scripts.
  • Remove secrets from the development environment. Tokens, cloud keys and deployment access belong in a secrets manager or in the CI pipeline, not as an environment variable on every workstation.
  • Pin dependencies. Lockfiles, pinned versions and an internal proxy for packages prevent a freshly compromised version from slipping unnoticed into the next build.
  • Check provenance instead of popularity. Star counts and project names say little about who currently holds write permissions on a repository.
  • Take two-factor authentication and permission assignment seriously. Hijacked accounts are the usual entry point into foreign repositories; restricted tokens and regularly reviewed access rights limit the damage.

Response capability is part of planning

Just as important as prevention is the question of what happens if it does occur. Teams should be able to answer which packages in which version are in which project, who deployed last and how quickly credentials can be replaced across the board. A software bill of materials, i.e. a machine-readable directory of all components used, is not an end in itself for this, but the basis of any quick answer.

A simple organisational rule is also helpful: anyone who notices a conspicuous incident – an unexpected script, a strange network access, an unusual build duration – reports it without pressure to justify themselves. Attacks of this kind usually stand out through small things that look like noise individually.

Rebalancing productivity and control

Switching off AI assistants is not a realistic answer. They take away routine work and noticeably shorten onboarding times. But their benefit arises from being allowed to act – and precisely this freedom of action must be deliberately tailored. A tiered approach makes sense: full automation in known internal projects, significantly tighter limits for anything coming from outside.

For web and software projects, this means: security can no longer be checked only at the end of the chain, but begins with the configuration of workstations and tools. Anyone introducing AI-supported development should document the permissions of these tools just as they do deployment processes or access roles.

And anyone who commissions service providers would do well to ask about isolation, dependency management and handling of access credentials – because today the risk travels through the supply chain, not through the firewall.

Sources