Skip to content
RCE Disclosed report Intermediate

Dependency confusion in https://github.com/hyperledger/aries-mobile-agent-react-native

The project's package manifest lists a dependency named aries-bifold that does not exist in the public npm registry. An attacker could publish a package under that name and gain remote code execution on every machine that installs the agent.

r3drush Follow

Originally disclosed on HackerOne

Informational View original
  • Triaged in 10 days
  • Disclosed after 3 months

Hi, I found dependency confusion vulnerability in your aries mobile agent.

The agent is installed through npm which then download thepublic packages required by the application. Those dependencies are defined through the package.json file. I found that your agent depends on the package "aries-bifold" that is not currently present in the public repository; an attacker could upload its malicious package and then gain remote code execution on every target installing the agent. I limited my research on finding the missing package without uploading the "malicious" package on npm because https://github.com/hyperledger/aries-mobile-agent-react-native is not in scope (but is not out-of-scope either), but the methods to exploit this vulnerability are well documented here:

  1. https://dhiyaneshgeek.github.io/web/security/2021/09/04/dependency-confusion/

More about this vulnerability from the researcher who discovered it: 2) https://medium.com/@alex.birsan/dependency-confusion-4a5d60fec610

Cheers, r3drush

Impact

Remote code execution to clients installing the agent

The original report as published on HackerOne, by r3drush. Images and videos are our own copies; raw HTML is shown as text. View it on HackerOne.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

How it worked

Root cause

Likely the package manifest referenced an internal or unpublished package name that was not reserved on the public npm registry, so the name was free for anyone to claim.

Impact

An attacker who claimed the missing package name could achieve remote code execution on clients installing the agent; the reporter did not actually upload a malicious package, so this was not demonstrated end to end.

What the attacker needed

Ability to publish to public npm; victim installs the agent

Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.

Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.

When a project is installed, a tool like npm fetches other packages it depends on by name from a public registry. If a name is not registered there, anyone can claim it and publish their own code under that name, which then runs on the victim's machine during install. This is called dependency confusion.

What is RCE?

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.

More from Linux Foundation Decentralized Trust

View all

The newest disclosed reports for this program.

Similar reports

View all

Same bug class and techniques, clearest first.

Remote code execution

The lesson behind this report.

Running the attacker's code on the target's servers: through command or code injection, unsafe deserialisation or template injection.