Skip to main content

link-preview-js CVE-2026-61704

| EUVDEUVD-2026-63439 HIGH
Server-Side Request Forgery (SSRF) (CWE-918)
2026-08-20 GitHub_M GHSA-cpjf-6666-r8fx
7.5
CVSS 3.1 · Vendor: GitHub_M
View

Attack ChainAIDerived

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

  1. Recon
    Register attacker-owned domain with short TTL
  2. Delivery
    Submit attacker domain URL to getLinkPreview() on target server
  3. Exploit
    Malicious DNS returns public IP during resolveDNSHost validation
  4. Install
    Validation passes; library fetches original hostname string
  5. C2
    DNS rebinds to internal/loopback address on second resolution
  6. Execute
    Server-side fetch reaches internal HTTP resource
  7. Impact
    Response content exfiltrated to attacker

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

The vulnerability requires that: (1) the target application runs link-preview-js in a server-side Node.js context with a version prior to 4.0.4; (2) the application accepts user-supplied URLs and passes them to getLinkPreview() using the resolveDNSHost callback as its SSRF mitigation; and (3) the attacker controls a DNS server authoritative for a domain they own, capable of returning different IP addresses across successive resolution queries within a short TTL window. Exploitation is limited by the DNS TTL race window - aggressive DNS caching at the OS or resolver level may close or narrow this window, making exploitation less reliable. Deployments with network-layer egress controls blocking RFC 1918, loopback, and link-local ranges cannot be exploited even if the DNS rebinding succeeds at the application layer. No authentication is required against the library itself (CVSS PR:N), but the attacker must have their own DNS infrastructure - this is achievable with free domain registrars and custom NS records but is not a zero-effort prerequisite.

Impact

The vendor-assigned CVSS 3.1 vector (AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N, score 7.5) rates attack complexity as Low, which overstates ease of exploitation: successful DNS rebinding requires the attacker to operate a DNS server authoritative for a domain they control, configure very short TTLs, and time the race between the library's validation and fetch phases. This is achievable but not trivially automated, suggesting AC:H is more accurate (assessed vector below reflects this). No EPSS score was included in the provided data, and this CVE does not appear in the CISA KEV catalog at time of analysis, supporting the view that exploitation is not yet widespread. The High confidentiality impact (C:H) is realistic: a successful bypass could expose internal HTTP services including cloud metadata endpoints (e.g., 169.254.169.254), internal APIs, or intranet resources. Deployments protected by egress firewall rules blocking RFC 1918 and loopback ranges at the network layer are effectively not exploitable regardless of this code flaw, making that network control a strong compensating measure. The same validation-to-fetch mismatch affects redirect handling, potentially widening the exploitable surface beyond direct hostname attacks.

Exploit ScenarioDerived

An attacker registers a domain with a short TTL (e.g., 1 second) and operates a malicious DNS server that initially returns a legitimate public IP (e.g., 1.2.3.4) when the library's resolveDNSHost callback resolves the hostname. Once that resolution passes validation, the DNS server flips to returning 169.254.169.254 or 192.168.0.1 on the next query; the library's fetch layer then resolves the hostname again and connects to that internal address, returning the response to the attacker. No public exploit code has been identified at time of analysis, but the full vulnerability mechanism is publicly documented in PR #181.

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

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

Alert me

AnalysisAIv1 – Aug 20, 2026

DNS rebinding in link-preview-js prior to 4.0.4 allows unauthenticated remote attackers to bypass the library's built-in SSRF protections and reach internal HTTP resources from the server hosting the preview service. The resolveDNSHost callback resolves a hostname once for validation but passes the original hostname back to the fetch layer, creating a time-of-check/time-of-use window that an attacker-controlled DNS server can exploit by returning a legitimate public IP during validation and an internal or loopback address on subsequent resolution. Vendor-released patch 4.0.4 is available; no public exploit identified at time of analysis, though the full fix is publicly documented in GitHub PR #181 and the GHSA-cpjf-6666-r8fx advisory.

RemediationAI

Upgrade link-preview-js to version 4.0.4, which resolves the DNS rebinding bypass by fetching the validated resolved IP address directly rather than re-resolving the original hostname (see https://github.com/OP-Engineering/link-preview-js/releases/tag/4.0.4 and patch commits 6ee25043 and f3a3dd84 referenced in GHSA-cpjf-6666-r8fx). As a compensating control prior to patching, enforce egress network policies at the OS or infrastructure layer to block outbound HTTP/S requests to RFC 1918 ranges (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16), loopback (127.0.0.0/8, ::1), and link-local (169.254.0.0/16) addresses - this eliminates exploitability even if the application-layer check is bypassed, though it may break intentional internal preview use cases that must then be explicitly allowlisted. Implementing a hostname allowlist in the application layer (restricting which domains users may submit for preview) provides an additional defense-in-depth layer with the trade-off of reduced functionality for arbitrary URL inputs.

Affected VersionsENISA

link-preview-js < 4.0.4

Affected Packages

npm link-preview-js fix: 4.0.4

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 (CPE: cpe:2.3:a:op-engineering:link-preview-js:*:*:*:*:*:*:*:*) is an npm library for Node.js that performs server-side HTTP fetches of user-supplied URLs to extract Open Graph metadata for link previews. CWE-918 (Server-Side Request Forgery) describes the root cause class: user-controlled URLs are fetched by the server, enabling attackers to redirect server requests to unintended destinations. The library attempted to mitigate this via a resolveDNSHost callback that resolves the hostname and validates the returned IP. The flaw is a TOCTOU (time-of-check/time-of-use) race: validation checks the DNS-resolved IP, but the actual fetch uses the original hostname string, allowing the DNS layer to be queried again - and to return a different address - between those two operations. The PR #181 diff confirms the fix substitutes the validated resolved IP directly into the fetch URL (e.g., fetching http://93.184.216.34/ instead of http://example.com/), and adds comprehensive IPv4-in-IPv6 normalization to block loopback variants such as ::ffff:127.0.0.1 and 64:ff9b::a9fe:a9fe. Redirect handling was affected by the same hostname-reuse pattern.

Know when Link Preview Js gets its next vulnerability

  • 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 (GitHub_M) PRIMARY 7.5 HIGH
AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
vuln.today AI 5.9 MEDIUM

AC:H reflects the DNS rebinding prerequisite of attacker-controlled DNS infrastructure and timing within the TTL window; no authentication required and confidentiality impact is high.

3.1 AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N
4.0 AV:N/AC:H/AT:P/PR:N/UI:N/VC:H/VI:N/VA:N/SC:N/SI:N/SA:N

Primary rating from Vendor (GitHub_M).

CVSS VectorVendor: GitHub_M

Attack Vector
Network
Attack Complexity
Low
Privileges Required
None
User Interaction
None
Scope
Unchanged
Confidentiality
High
Integrity
None
Availability
None

Lifecycle Timeline

2
Patch available
Aug 20, 2026 - 17:02 EUVD
CVE Published
Aug 20, 2026 - 16:21 cve.org
HIGH 7.5

DescriptionCVE.org

Link Preview JS extracts web links information. Prior to 4.0.4, the resolveDNSHost mitigation in index.ts validates one resolved IP address but fetches the original hostname, allowing an attacker-controlled DNS server to return a public address during validation and a loopback or internal address during the final connection. This DNS rebinding condition bypasses the SSRF protection and can cause the server-side preview fetch to reach internal HTTP resources. Redirect handling is affected by the same validation-to-fetch mismatch. This issue is fixed in version 4.0.4.

Executive ViewAI

Why It Matters

link-preview-js versions prior to 4.0.4 contain a DNS rebinding vulnerability that permits unauthenticated attackers to bypass SSRF protections and access internal HTTP resources on servers running the library. Organizations deploying link-preview services face direct exposure of internal APIs, cloud metadata endpoints, and backend systems to remote exploitation. Immediate remediation is necessary to protect internal infrastructure from unauthorized access.

Business Impact: High
Compensating Controls

Apply vendor patch.

Threat Intelligence Overview

EPSS Score
0.4%
Top 66% exploitable
Prevalence
Medium
popular npm library for server-side link preview metadata
Threat Intel
1
1 source
Data Quality
6 sources
Confidence: High

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.4%
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

38
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +38
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.

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