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
Yet the url.parse() method (which is used in there) has known security vulnerabilities and is no longer recommended. The Node.js documentation suggests replacing it with the modern and more secure WHATWG URL API (new URL()).
The text was updated successfully, but these errors were encountered:
outslept
changed the title
Concerns about parseurl and replacing it with new URL()
Concerns about parseurl and possibly replacing it with new URL()Feb 11, 2025
Are there packages that do the same and are secure?
Hey, to clarify a few things:
Using url.parse() is still technically fine if you completely trust your input sources and yada yada.
I looked around but couldn't find any direct replacements that provide the exact same API while using new URL() under the hood. This is likely because:
The deprecation is relatively recent
Changing the underlying implementation while maintaining the exact same API is tricky due to differences between url.parse() and new URL() behavior
Possible implications:
For completely trusted environments where you control the input, continuing to use parseurl is likely fine
For new projects, using new URL() directly would be the better approach
For existing projects, careful testing would be needed before replacing parseurl since it's used by many major frameworks
That's why I'm asking - while we want people to use secure methods, given that this library seems somewhat inactive, I'm not sure what would be the best path forward here.
Repo doesn't seem to be active whole lot:
https://github.com/pillarjs/parseurl
Yet the url.parse() method (which is used in there) has known security vulnerabilities and is no longer recommended. The Node.js documentation suggests replacing it with the modern and more secure WHATWG URL API (new URL()).
References:
Is there anything we can do about it?
The text was updated successfully, but these errors were encountered: