<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>16105</bug_id>
          
          <creation_ts>2025-12-17 16:35:30 +0000</creation_ts>
          <short_desc>NPM fetcher is insecure</short_desc>
          <delta_ts>2026-09-29 08:19:37 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>BitBake</product>
          <component>bitbake</component>
          <version>unspecified</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>Medium+</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>6.99</target_milestone>
          
          <blocked>15551</blocked>
    
    <blocked>15607</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Paul Barker">paul</reporter>
          <assigned_to name="Thomas Perrot">thomas.perrot</assigned_to>
          <cc>ccasciato</cc>
    
    <cc>contact</cc>
    
    <cc>mathieu.dubois-briand</cc>
    
    <cc>pavel</cc>
    
    <cc>poky.bs.watcher</cc>
    
    <cc>poky.watcher</cc>
    
    <cc>pokylinux</cc>
    
    <cc>randy.macleod</cc>
    
    <cc>ross.burton</cc>
    
    <cc>thomas.perrot</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>Don&apos;t know</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>103584</commentid>
    <comment_count>0</comment_count>
    <who name="Paul Barker">paul</who>
    <bug_when>2025-12-17 16:35:30 +0000</bug_when>
    <thetext>The NPM fetcher is being disabled as it is insecure. To re-enable this, we need the security issues to be resolved *AND* tests to be added.

The NPM fetcher gets the checksum for each source from the remote registry. This contradicts our usual policy of storing checksums in the recipe so that we can ensure that the remote file has not been altered. If the remote is in charge of both the checksum and the source contents, we can&apos;t detect tampering from a compromised NPM registry.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103596</commentid>
    <comment_count>1</comment_count>
    <who name="Randy MacLeod">randy.macleod</who>
    <bug_when>2025-12-18 15:52:23 +0000</bug_when>
    <thetext>Richard to disable for M1.
Then lower to medium, 60 priority and unassigned.
We need help from npm users here.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>103735</commentid>
    <comment_count>2</comment_count>
    <who name="Paul Barker">paul</who>
    <bug_when>2026-01-07 14:39:14 +0000</bug_when>
    <thetext>If we need something to test with, there are recipes on the master branch of meta-luneos (https://layers.openembedded.org/layerindex/branch/master/layer/meta-luneos/) which use npm:// and npmsw:// SRC_URIs.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104054</commentid>
    <comment_count>3</comment_count>
    <who name="Richard Purdie">richard.purdie</who>
    <bug_when>2026-01-23 12:01:07 +0000</bug_when>
    <thetext>NPM fetcher has been disabled:

https://git.openembedded.org/bitbake/commit/?id=355cd226e0720a9ed7683bb01c8c0a58eee03664

Reclassifiy the bug as a medium+ unassigned as a result.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>104325</commentid>
    <comment_count>4</comment_count>
    <who name="Walter Werner Schneider">contact</who>
    <bug_when>2026-02-16 17:28:31 +0000</bug_when>
    <thetext>There are multiple package managers for JS that can use the same registries, I&apos;m thinking that there&apos;s some sort of standard API, I&apos;ll look it up and see what other fetches do and I&apos;ll try to implement something.

Not sure what npmsw does, but the npm fetcher doesn&apos;t even lock direct dependencies, meaning that you will end up with different dependencies once those dependencies have new releases.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>105758</commentid>
    <comment_count>5</comment_count>
    <who name="Thomas Perrot">thomas.perrot</who>
    <bug_when>2026-06-05 11:03:16 +0000</bug_when>
    <thetext>Hello,

I propose to discard any checksum obtained from the registry and instead require the recipe author to supply the checksum directly in SRC_URI (sha512sum=, sha256sum=).
The .resolved cache file would then store only the bare tarball URL.

Kind regard,
Thomas</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106050</commentid>
    <comment_count>6</comment_count>
    <who name="Thomas Perrot">thomas.perrot</who>
    <bug_when>2026-06-30 12:41:35 +0000</bug_when>
    <thetext>I submitted a patch series:
https://lore.kernel.org/all/20260616-dev-tprrt-fix-npm-v1-0-6fde95bf0a8b@bootlin.com/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106570</commentid>
    <comment_count>7</comment_count>
    <who name="Mathieu Dubois-Briand">mathieu.dubois-briand</who>
    <bug_when>2026-08-20 12:36:26 +0000</bug_when>
    <thetext>Patches got merged:

https://git.openembedded.org/bitbake/commit/?id=f7608f3195af9abb405af9be95286e2267221331
https://git.openembedded.org/bitbake/commit/?id=9e45e00a2009f28829417c9517f5ab623f66dd5d
https://git.openembedded.org/bitbake/commit/?id=355cd226e0720a9ed7683bb01c8c0a58eee03664

Paul, Thomas: can we close this bug entry?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>106956</commentid>
    <comment_count>8</comment_count>
    <who name="Paul Barker">paul</who>
    <bug_when>2026-09-29 08:19:37 +0000</bug_when>
    <thetext>This has been resolved by the commits Mathieu linked to above. Further hardening of the npm fetcher is likely possible but that&apos;s a job for another bug.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>