Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoiding Lodash version disclosure #5829

Open
lokeshv12 opened this issue Mar 8, 2024 · 5 comments
Open

Avoiding Lodash version disclosure #5829

lokeshv12 opened this issue Mar 8, 2024 · 5 comments

Comments

@lokeshv12
Copy link

As documented at https://www.invicti.com/web-vulnerability-scanner/vulnerabilities/version-disclosure-lodash/, Lodash makes its version accessible to the user through a browser's developer tools.

This is reproducible by adding a dependency on Lodash 4.17.21 in a skeleton Angular project.

I realize the difficulty in redacting this information since Lodash is a client-side Javascript utility library, but is there any way to configure Lodash to redact this information, or is it possible that it is not required and can be removed from Lodash?

How to test it?
Use console.log(.templateSettings.imports..templateSettings.imports._.VERSION); on the browser console

@ThiefMaster
Copy link

ThiefMaster commented Mar 26, 2024

If you are in a situation, where you can read the version via devtools, you already have code execution privileges.
If you are doing recon on another website e.g. to find vulns, you can just guess the version based on the source code (yes, even if minified). Or just try to exploit the issues straight away.

So it makes absolutely no sense to try to hide the version of a client-side library.

@mfernandes-alcumus
Copy link

This issue is causing some security concerns in my organization is someone able to looking into it?

@ThiefMaster
Copy link

Tell whoever raised those concerns that it's trivial to determine a library version anyway...

@Trott
Copy link

Trott commented May 13, 2024

The last vestige of this issue was removed from the main branch of lodash in 2019 in 40e9c66.

Unfortunately, that commit wasn't included in the 4.17.21 release that went out the following month, and there hasn't been a subsequent release of lodash in that time. (And it doesn't seem like there's a release coming any time soon, although I would be delighted to be wrong about that.)

Fortunately, this is not actually a significant security issue. Your security scanners and information security officers are participating in a false positive race to the bottom. Sure, lodash can redact the version information, but that's security through obscurity. Since the version disclosure issue is only a problem on the client side, the attacker can simply inspect the payload to determine the version or not even bother and just run whatever exploit they would use on a vulnerable version and see if it works.

@arunnambissan
Copy link

arunnambissan commented May 14, 2024

This vulnerability might be caused because the lodash object is exported globally and it can be accessed directly using window._

You could get rid of this vulnerability issue by following the solution suggested here - #2671 (comment)

Link to the solution: webpack/webpack#3017 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

5 participants