3 ms·
I wrote a wall of text earlier. Some of my opinion was misinformed. The dev patched this bug when it was disclosed in 2022. The chief complaint was him getting
by nunez 2y ago
I wrote a wall of text earlier. Some of my opinion was misinformed. The dev patched this bug when it was disclosed in 2022.
The chief complaint was him getting tons of issues/PRs about _old_ versions of the library that still contained the bug.
Knowing this now, I can understand why they decided to archive the thing.
I still stand by package management being a huge problem within Node that just encourages shit like this to happen.
---
OLD POST: From one of the sources [0] of the CVE:
> Root Cause:
> The root cause of this vulnerability is the ip.isPublic function's inability to correctly interpret and classify certain IP address representations.
> Specifically, the function fails to recognize 0x7f.1 as a private IP address, which is actually a hexadecimal and shorthand notation for 127.0.0.1, a well-known loopback address.
> This misinterpretation leads to the function erroneously categorizing a private IP as public, thereby opening up the potential for Server-Side Request Forgery (SSRF) attacks. The core issue lies in the inadequate handling of non-standard IP address formats by the IP address validation mechanism.
It then goes on to demonstrate that "ip.isPublic" would classify "0xf.1" as "globally-routable" 127.0.0.1.
So instead of patching this very obviously huge security vulnerability in a package that has been downloaded 17 MILLION TIMES, the maintainer decides "screw it" and abandons the repo.
(The PortSwigger academy has a course on SSRF, and their labs let you fool around with some exfiltration/remote code execution scenarios triggered by a PHP module doing essentially the same thing this CVE is warning about.)
While someone will, of course, fork this project and provide a fix that others can reference in their "package.json" manifests, hoards of projects will probably see downtime due to security forcing them to scale down and fix this.
While this can, for sure, happen with other languages (like how the requests module in Python had a serious vulnerability some time back), this risk is exponentially worse with Node since JavaScript doesn't really have a stdlib and every little thing (like a timer [1]) is just painful enough to make downloading some arbitrary library attractive.
[0] https://cosmosofcyberspace.github.io/npm_ip_cve/npm_ip_cve.html https://cosmosofcyberspace.github.io/npm_ip_cve/npm_ip_cve.h...
[1] https://stackoverflow.com/questions/29971898/how-to-create-an-accurate-timer-in-javascript https://stackoverflow.com/questions/29971898/how-to-create-a...