Open gernot-h opened 4 weeks ago
By the way, you can also easily inspect the changes using Yarn's cacheFolder
, you will find both unchanged and patched version of resolve
there.
So if you would consider the cache content as "patched package", this would remind me to the situation we have with Linux distributions which also carry their own patches. For those, you just refer to "Debian package linux 6.1.112-1" in your BOM, and the consumers know how to resolve the corresponding patches. So perhaps just specifying some special version string and a purl qualifier would also be enough here?
Thank you for the ticket, @gernot-h .
In general, this is not a bug but a lack of feature. Are you interested in working on a solution?
Here are some remarks:
So the only trace of the patch you see in the SBOM is the bom-ref which should be opaque to BOM consumers, I guess.
The bom-ref
has no meaning, it is just an arbitrary string, unique in universe of the SBOM it ocurred in.
To be honest, I'm unsure whether the information should be better provided using pedigree/patches,
yes. such modifications are intended to be documented as "pedigree".
Thank you for the ticket, @gernot-h .
Thanks for the super-fast reply!!
In general, this is not a bug but a lack of feature. Are you interested in working on a solution?
Unfortunately, my JS/TS/Yarn skills are ... very limited, I wouldn't only need to dive into TypeScript, but I also have only a very rough understanding of the involved Yarn (patching) details so I wouldn't feel too comfortable shaping a best practice here.
To be honest, I'm unsure whether the information should be better provided using pedigree/patches,
yes. such modifications are intended to be documented as "pedigree".
As it seems that the hash
string Yarn adds to the version number is nothing one could lookup somewhere, I agree that explicitely listing the patches in the BOM might be the best solution. While it sounds like adding a lot of complexity to the backend consuming the SBOM which needs to retrieve the involved patches...
Describe the
bugfeatureYarn's builtin @yarnpkg/plugin-compat will automatically patch specific packages upon install. As far as I can see, this is not reflected in the created SBOM.
To Reproduce
So the only trace of the patch you see in the SBOM is the
bom-ref
which should be opaque to BOM consumers, I guess.Looking at the version and purl, you would assume that an unchanged resolve as available from NPM is in your system while in fact, this patch (readable version) was applied to it.
Expected behavior
To be honest, I'm unsure whether the information should be better provided using
pedigree/patches
, using something like1.22.8&hash=c2c19d
asversion
... or if this would even justify to extend the purl specification...Environment
Tested on:
docker pull node:23-bookworm