Skip to main content

link-preview-js CVE-2026-43897

HIGH
Server-Side Request Forgery (SSRF) (CWE-918)
2026-05-05 https://github.com/OP-Engineering/link-preview-js GHSA-4gp8-rjrq-ch6q
8.7
CVSS 4.0 · Vendor: https://github.com/OP-Engineering/link-preview-js
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Submit malicious URL via application interface
  2. Delivery
    Application passes URL to link-preview-js
  3. Exploit
    Regex validation bypass via IPv6/DNS rebinding
  4. Execution
    HTTP fetch to internal target
  5. Persist
    Retrieve sensitive internal data
  6. Impact
    Exfiltrate via preview response

Vulnerability Assessment

Weakness
CWE
OWASP Top 10:2025
A01:2025 - Broken Access Control
ASVS 5.0
V4 - API and Web Service URL allowlisting, SSRF prevention
MITRE ATT&CK

2 techniques across 2 tactics: Initial Access, Credential Access

The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up.

Exploitation Conditions

Exploitation requires the application to invoke link-preview-js with user-controlled URL input without implementing custom validation beforehand. The vulnerability is exploitable against default configurations of link-preview-js versions <= 4.0.0 with network-accessible attack surface (applications that accept URLs from untrusted users via web forms, APIs, or messaging interfaces). No authentication is required at the link-preview-js layer, though the overall application may require authenticated user sessions to submit URLs. Exploitation is LIMITED by network topology: maximum impact occurs when the vulnerable application server can reach internal network resources, cloud metadata endpoints, or localhost services. Applications deployed with strict egress filtering, in isolated network segments without access to sensitive internal services, or with metadata endpoint protection (IMDSv2 on AWS) face reduced impact. The attack requires NO user interaction beyond the application processing the attacker-supplied URL. For DNS rebinding attacks specifically, exploitation requires DNS resolution to succeed and return an internal IP, which may fail if the application uses DNS servers that filter rebinding attempts or if the attacker-controlled domain is blocked.

Impact

Real-world risk is MODERATE despite the critical nature of SSRF vulnerabilities. The attack requires the application to accept user-controlled URLs for preview generation, which is common in chat applications, content management systems, and social media platforms using this library. Attack complexity is LOW once an attacker identifies the library in use - crafting IPv6 loopback or DNS rebinding URLs requires minimal skill. However, impact varies significantly by deployment context: applications running in cloud environments (AWS EC2, GCP, Azure) face HIGH risk due to accessible metadata endpoints (169.254.169.254) that expose IAM credentials and secrets. Internal enterprise deployments face MEDIUM risk limited to accessing internal documentation or APIs visible to the application server. The lack of CVSS scoring prevents quantitative comparison, but the vulnerability profile matches typical CVSS 7.5-8.5 SSRF issues (AV:N/AC:L). Exploitation likelihood is reduced by two factors: (1) the vulnerability requires the application to use link-preview-js specifically for user-supplied URLs, and (2) defensive configurations like network segmentation and metadata endpoint protection provide partial mitigation. The patch's incompleteness - requiring developers to implement resolveDNSHost option - means many installations will remain vulnerable post-upgrade if they only update the package without code changes. CRITICAL GAP: No EPSS or KEV data available to assess whether attackers are actively targeting this specific library, though generic SSRF exploitation is widespread.

Exploit ScenarioDerived

An attacker identifies a chat application using link-preview-js to generate rich preview cards from URLs shared in conversations. The attacker posts a malicious URL like http://[::ffff:127.0.0.1]:8080/admin/users to access the application's internal admin API, or http://169.254.169.254.sslip.io/latest/meta-data/iam/security-credentials/ to retrieve AWS IAM credentials if the application runs on EC2. The link-preview-js library fetches the internal resource using the application's server-side context, bypassing external firewalls. The attacker receives the internal API response or metadata embedded in the preview card data, exfiltrating sensitive configuration, credentials, or internal system information. If the internal service lacks authentication, the attacker gains full access to sensitive endpoints not intended for external exposure.

This Week Schedule remediation this week. Why: HIGH severity (CVSS 7.0-8.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv1 – May 05, 2026

Server-Side Request Forgery (SSRF) in link-preview-js npm package allows attackers to craft URLs that bypass validation to access internal network resources via IPv6 loopback addresses (::1, ::ffff:127.0.0.1) and DNS rebinding attacks using wildcard services (.internal, .local, .nip.io, .sslip.io domains). Successful exploitation enables reading internal metadata endpoints, accessing private network services, and exfiltrating sensitive data from cloud instance metadata or internal APIs. Vendor-released patch in version 4.0.1 tightens regex validation but requires users to implement DNS resolution via resolveDNSHost option for complete protection. No public exploit identified at time of analysis, though the attack techniques are well-documented SSRF methods.

RemediationAI

Upgrade to link-preview-js version 4.0.1 or later as released at https://github.com/OP-Engineering/link-preview-js/releases/tag/4.0.1 and detailed in pull request https://github.com/OP-Engineering/link-preview-js/pull/179. CRITICAL ADDITIONAL STEP REQUIRED: The patch alone is insufficient. After upgrading, developers MUST implement DNS resolution validation by enabling the resolveDNSHost configuration option, which performs DNS lookups before fetching content and validates the resolved IP address is not internal. Without this configuration change, applications remain vulnerable to DNS rebinding attacks against non-blacklisted domains. For applications unable to immediately upgrade, implement custom URL validation that rejects IPv6 addresses matching ::1, ::ffff:127.x.x.x, fc00::/7, and fe80::/10 ranges, blocks hostnames ending in .internal, .local, .nip.io, and .sslip.io, and performs DNS resolution to verify the target IP is not in private ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 127.0.0.0/8, 169.254.0.0/16). Note that custom validation workarounds require maintaining regex patterns as new rebinding services emerge, while the resolveDNSHost option provides runtime protection. If implementing workarounds, application performance may degrade due to additional DNS lookups in the request path, requiring DNS caching strategies.

Affected Packages

npm link-preview-js fix: 4.0.1

Source: OSV (Open Source Vulnerabilities)

Affects your stack

Affects 1 package in npm

Checking this CVE against your own stacks and servers is part of the Basic plan and up.

Technical ContextAI · show details

link-preview-js is an npm package (pkg:npm/link-preview-js) that fetches and parses link metadata for generating preview cards in web applications. The vulnerability stems from insufficient URL validation before making HTTP requests (CWE-918: Server-Side Request Forgery). The original regex-based validation failed to detect IPv6 loopback addresses including compressed notation (::1), IPv4-mapped IPv6 loopback (::ffff:127.0.0.1), Unique Local Addresses (fc00::/7), and link-local addresses (fe80::/10). Additionally, DNS rebinding attacks were possible where attacker-controlled domains could resolve to internal IP ranges, bypassing the validation layer entirely. The library would then fetch content from these internal addresses using the application's credentials and network position. The patch (commit 4396d48) adds comprehensive IPv6 pattern matching to REGEX_LOOPBACK and blacklists known DNS rebinding service TLDs, but the vendor explicitly states complete mitigation requires application-level DNS resolution validation before URL fetching.

Know when the next one hits your stack

  • Watch products and get an email when something new is published
  • Check this CVE against your own stack and servers
  • Exploit and PoC references, threat intelligence from 22 sources

No credit card · 7-day full trial

Severity by source

Vendor (https://github.com/OP-Engineering/link-preview-js) PRIMARY 8.7 HIGH
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (https://github.com/OP-Engineering/link-preview-js) · only source for this CVE.

CVSS VectorVendor: https://github.com/OP-Engineering/link-preview-js

Attack Vector
Network
Attack Complexity
Low
Attack Requirements
None
Privileges Required
None
User Interaction
None
Vulnerable system: Confidentiality
High
Vulnerable system: Integrity
None
Vulnerable system: Availability
None
Subsequent system: Confidentiality
None
Subsequent system: Integrity
None
Subsequent system: Availability
None

Lifecycle Timeline

1
CVSS changed
May 11, 2026 - 22:37 NVD
8.7 (HIGH)

DescriptionCVE.org

Impact

The library did not check for IPv6 loopback attacks. There was also a DNS attack, where an address could be resolved into an internal IP. This could cause internal data leaks.

Patches

Problem has been patched in version 4.0.1. However, it cannot be completely solved by the package alone. The regex used for validation has been tightened for IPv6 addresses.

The DNS resolving, however, is more difficult. The regex has been tightened to prohibit .internal, .local, .nip.io and .sslip.io addresses, however there can be other services not on the list, therefore it is imperative that users use the resolveDNSHost option to do DNS resolution before fetching content. To that regard a (scary) error message has been added when the option is not set.

Workarounds

Users can do their own validation before fetching content.

Reported by https://github.com/Andrew-most-likely

Executive ViewAI

Why It Matters

The link-preview-js npm package (versions prior to 4.0.1) contains a Server-Side Request Forgery vulnerability that allows attackers to bypass URL validation and access internal network resources, including cloud metadata endpoints and private APIs. Organizations using this library in production applications face immediate risk of unauthorized data exfiltration and lateral movement into internal infrastructure.

Business Impact: High
Compensating Controls

Apply vendor patch. If immediate patching is not feasible, implement network-level controls: restrict outbound access from affected services to non-production internal networks, block DNS resolution to wildcard domains (.nip.io, .sslip.io, .internal, .local), and enforce authentication on all internal metadata endpoints and private APIs.

Threat Intelligence Overview

EPSS Score
0.0%
Top 88% exploitable
Threat Intel
1
1 source
Data Quality
4 sources
Confidence: Medium

How this decision was reached

The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.

SignalValue
Severity HIGH
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
HIGH severity (CVSS 7.0-8.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

SSVC Decision· derived
Scheduled
Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
Yes
Human Impact
High

Priority Score

44
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +44
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

Server-Side Request Forgery exploits applications that fetch remote resources based on user-supplied URLs.

Affected Products (CPE)CVE.org

pkg:npm/link-preview-js

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy