The install fallback passes an npm bearer token to a tarball URL from registry metadata using only a substring hostname check, and its request helper follows redirects without constraining the destination. This is a real credential-routing vulnerability, though exploitation depends on control of the registry-provided URL or redirect.
Static reason
One or more suspicious static signals were detected.
Trigger
Package installation when the optional platform binary is unavailable and NPM_TOKEN is set.
Impact
An attacker controlling the metadata URL or redirect destination could receive the installer's npm bearer token.
Mechanism
The postinstall fallback reads dist.tarball from npm registry metadata and requests it using makeRequest, which sends the token based on a substring hostname check and follows redirects without host validation.
Evidence
package.jsoninstall.jsbin/droid
Network endpoints2
registry.npmjs.orgTarball URL and redirect destinations supplied at runtime; hostname is not constrained beyond containing “npmjs.org”.