You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// When extracting a registry-resolved package, the spec we hand to pacote is name@URL.
840
+
// pacote re-parses that with npa and gets spec.type === 'remote', so without an override the allow-remote gate would fire on every registry tarball (both =none and =root mis-fire).
841
+
// Returns true only when we are confident this is a registry-mediated install: the node's inbound edges must all be registry-typed (no exotic spec smuggled the URL in) AND the resolved URL's host must match the registry npm-registry-fetch selected for this spec, so a tampered lockfile pointing at an attacker host still hits the gate.
842
+
#isRegistryResolvedTarball (node){
843
+
if(!node.resolved||!node.isRegistryDependency){
844
+
returnfalse
845
+
}
846
+
try{
847
+
constresolvedHost=newURL(node.resolved).hostname
848
+
// pickRegistry only consults spec.scope, so a bare-name (tag) parse is sufficient and avoids a node.version dependency.
0 commit comments