CVE-2018-3747: Cross-Site Scripting in public
Summary
CVE-2018-3747: Cross-Site Scripting in public. Affects public versions < 0.1.4. Fixed in 0.1.4. How to fix ↓
Check if this vulnerability affects your application
Upload a manifest or SBOM and we'll show whether you're affected, plus every other risky package in the same scan.
No signup required · Results in about 60 seconds
Background
The 'public' package is an npm module that is used for handling public files. It allows users to upload and manage files on a web server. However, versions prior to 0.1.4 of the 'public' package are vulnerable to Cross-Site Scripting (XSS) attacks. This vulnerability occurs due to the package's failure to properly sanitize filenames, which allows attackers to execute arbitrary JavaScript code in the victim's browser through files with malicious names.
Vulnerability Detail
The Cross-Site Scripting (XSS) vulnerability in the 'public' package can have severe consequences. Attackers can exploit this vulnerability by uploading files with malicious names that contain JavaScript code. When a user accesses these files, the JavaScript code is executed in their browser, allowing the attacker to perform various malicious actions, such as stealing sensitive information, manipulating web content, or performing unauthorized actions on behalf of the user. This vulnerability has a CVSS score of 6.1, indicating a moderate severity level.
How To Fix
Latest published version: 0.1.5 as of 22 Oct 2026
npm install public@0.1.5
Upgrading to it may include breaking changes; the version below is the minimum fixed release for this vulnerability.
If you need the minimum change
0.1.4
This is the first release that contains the fix.
npm install public@0.1.4
Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →
Conclusion
The 'public' package prior to version 0.1.4 is vulnerable to Cross-Site Scripting (XSS) attacks. Upgrading to version 0.1.4 or later is necessary to fix this vulnerability. It is recommended to regularly update packages and use tools like Vulert to monitor and mitigate open-source vulnerabilities. For further support on vulnerability remediation, please contact DevNack.com.
See every vulnerability recorded for public →
FAQ
This vulnerability allows attackers to execute arbitrary JavaScript code in the victim's browser, potentially leading to unauthorized actions, data theft, or manipulation of web content.
You can use the Vulert Playground at Vulert Scanner to check if your application is affected by this vulnerability. The playground analyzes your package-lock.json file and provides real-time alerts for open-source vulnerabilities, including this XSS vulnerability in the 'public' package.
No, there are no known workarounds for this vulnerability. It is recommended to upgrade to the latest version of the 'public' package to fix the issue.
There is no specific evidence of active exploits targeting this vulnerability. However, it is crucial to promptly upgrade to the patched version to mitigate the risk of potential attacks.
This vulnerability was discovered and reported by the GitHub Security Lab.
Related vulnerabilities
Recent vulnerabilities recorded for public.