Skip to contentSkip to conversation

fetch2/npm/npmsw: Disable npm and npmsw fetchers due to security concerns

PATCH Richard Purdie 2 participants 2 messages Jan 21 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 36 lines · Richard Purdie via lists.openembedded.org

We've been made aware that are security issues within the npm/npmsw fetchers. The issue is that the code accepts data like checksums from the upstream servers, rather than verifying it against local data from the recipes. This means the upstream servers could feed aritrary data into the build.

There have been maintainance issues on these fetchers for a while and despite asking in multiple forums, we've been unable to find anyone to help fix the issues. Until that issue is resolved and we can be convinced the fetcher is secure and modelling best practices for reproduciblity (inc. mirroring), this patch disables the fetchers. This has been discussed and agreed by the OE TSC.

Parsing will not show errors but the recipes using these fetchers will not be available. Recipes will be skipped at parsing amd will show an error if a user tries to build a recipe using them.

[YOCTO #16105]

---
 lib/bb/fetch2/npm.py   | 5 ++++-
 lib/bb/fetch2/npmsw.py | 4 ++++

 2 files changed, 8 insertions(+), 1 deletion(-)
lib/bb/fetch2/npm.py +0 -0
index e469d667687..15057da7d3f 100644
@@ -39,6 +39,7 @@ from bb.fetch2 import URI

 from bb.fetch2 import check_network_access
 from bb.fetch2 import runfetchcmd
 from bb.utils import is_semver
+from bb.parse import SkipRecipe

 def npm_package(package):
     """Convert the npm package name to remove unsupported character"""

lib/bb/fetch2/npm.py +0 -0
@@ -150,7 +151,9 @@ class Npm(FetchMethod):
Quoted 7 lines


     def supports(self, ud, d):
         """Check if a given url can be fetched with npm"""
-        return ud.type in ["npm"]
+        #return ud.type in ["npm"]
+        if ud.type in ["npm"]:
+            raise SkipRecipe("The npm fetcher has been disabled due to security issues and there is maintainer to address them")

I will fix this to say "there is no maintainer to address them" on both messages.

Cheers,

Richard

#2 lore raw
Quoted 56 lines · On Wed, 21 Jan 2026, 19:44 Richard Purdie via lists.openembedded.org…
Quoted 1 line · Richard Purdie via lists.openembedded.org

We've been made aware that are security issues within the npm/npmsw

fetchers.

Quoted 2 lines

The issue is that the code accepts data like checksums from the upstream servers, rather than verifying it against local data from the recipes.

This

Quoted 3 lines

means the upstream servers could feed aritrary data into the build.

There have been maintainance issues on these fetchers for a while and

despite

Quoted 1 line

asking in multiple forums, we've been unable to find anyone to help fix

the

Quoted 1 line

issues. Until that issue is resolved and we can be convinced the fetcher

is

Quoted 1 line

secure and modelling best practices for reproduciblity (inc. mirroring),

this

Quoted 1 line

patch disables the fetchers. This has been discussed and agreed by the

OE TSC.

Quoted 2 lines

Parsing will not show errors but the recipes using these fetchers will

not be

Quoted 1 line

available. Recipes will be skipped at parsing amd will show an error if

a user

Quoted 23 lines

tries to build a recipe using them.

[YOCTO #16105]

---
 lib/bb/fetch2/npm.py   | 5 ++++-
 lib/bb/fetch2/npmsw.py | 4 ++++
 2 files changed, 8 insertions(+), 1 deletion(-)
lib/bb/fetch2/npm.py +1 -0
index e469d667687..15057da7d3f 100644
@@ -39,6 +39,7 @@ from bb.fetch2 import URI
 from bb.fetch2 import check_network_access
 from bb.fetch2 import runfetchcmd
 from bb.utils import is_semver
+from bb.parse import SkipRecipe
 
 def npm_package(package):
     """Convert the npm package name to remove unsupported character"""

lib/bb/fetch2/npm.py class Npm(FetchMethod): · line 156

Quoted 7 lines
lib/bb/fetch2/npm.py +3 -1
@@ -150,7 +151,9 @@ class Npm(FetchMethod):
 
     def supports(self, ud, d):
         """Check if a given url can be fetched with npm"""
-        return ud.type in ["npm"]
+        #return ud.type in ["npm"]
+        if ud.type in ["npm"]:
+            raise SkipRecipe("The npm fetcher has been disabled due to

security issues and there is maintainer to address them")

Quoted 3 lines

I will fix this to say "there is no maintainer to address them" on both messages.

Thanks Richard, there's also a typo in the commit message "amd" -> and if you're rebasing.

Cheers,
Marta

Quoted 1 line