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
could accidentally match on domains like registry.npmjs.evil.com, malware.python.evil.org, evilnuget.org or evilsourceforge.net as well. If someone relies on this package to confirm whether a package URL is from a trusted source (doesn't sound like its intended purpose, but you never know what people do with your library), they could be fooled by malicious domains like these and download malware instead.
where an attacker only has a small amount of possible domains (eg. raw_githubusercontent.com, apixgithub.com, hackageehaskell.org, storageggoogleapis.com) which could also match (since the . isn't escaped and treated like a wildcard character)
My recommendation (even if it isn't a security issue right now, but to prevent one in the future) would be to escape these regexes more carefully. Something like (.+\\.)?python\\.org and hackage\\.haskell\\.org
The text was updated successfully, but these errors were encountered:
Thanks! I get we can make these patterns more selective, but I am not sure how an attacker could do anything, and what would be the process and proof of concept?
I don't have a Proof of Concept yet, but to me it seems that the following pieces of code:
could accidentally match on domains like
registry.npmjs.evil.com
,malware.python.evil.org
,evilnuget.org
orevilsourceforge.net
as well. If someone relies on this package to confirm whether a package URL is from a trusted source (doesn't sound like its intended purpose, but you never know what people do with your library), they could be fooled by malicious domains like these and download malware instead.A bit harder would be to abuse regexes like
where an attacker only has a small amount of possible domains (eg.
raw_githubusercontent.com
,apixgithub.com
,hackageehaskell.org
,storageggoogleapis.com
) which could also match (since the.
isn't escaped and treated like a wildcard character)My recommendation (even if it isn't a security issue right now, but to prevent one in the future) would be to escape these regexes more carefully. Something like
(.+\\.)?python\\.org
andhackage\\.haskell\\.org
The text was updated successfully, but these errors were encountered: