CVE-2022-25876: Server-Side Request Forgery in link-preview-js

link-preview-js Updated 02 Oct 2025

Summary

02/07/2022
Yes i
Moderate
5.5

CVE-2022-25876: Server-Side Request Forgery in link-preview-js. Affects link-preview-js versions < 2.1.17. Fixed in 2.1.17. How to fix ↓

Free scan

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.

Check my app free

No signup required · Results in about 60 seconds

Upload your dependency manifest or SBOM

Drag & drop your file here or

Java Javascript PHP Python Go Rust Ruby Dart C/C++ Elixir CycloneDX SPDX

Upload a supported dependency manifest or SBOM. No installation or source-code access required.

See supported files and SBOM formats
SBOM sbom.json · bom.json · bom.xml · *.spdx.json · *.cdx.json · *.cdx.xml
Java pom.xml · gradle.lockfile · buildscript-gradle.lockfile
Javascript package-lock.json · yarn.lock · pnpm-lock.yaml
PHP composer.lock
Python poetry.lock · requirements.txt · Pipfile.lock
Go go.mod
Rust Cargo.lock
Ruby Gemfile.lock
Dart pubspec.lock
C/C++ conan.lock
Elixir mix.lock
Enter your work email to receive your report link.

Verify your email to view the full report and start 30 days of continuous monitoring. No credit card required.

Sponsored Devnack Your last release was probably never penetration tested Manual testing by engineers who build software, not an auditor's checklist. Trusted by teams at Swift and Google Talk to Devnack

Background

link-preview-js is an npm package that provides functionality for generating link previews. It allows users to extract metadata from URLs and display a preview of the linked content. The package is widely used in web applications to enhance the user experience by providing a visual representation of external links. However, versions before 2.1.17 are vulnerable to Server-side Request Forgery (SSRF), which can lead to unauthorized access to internal resources and potential data leakage.

Vulnerability Detail

The vulnerability in link-preview-js arises from flawed DNS rebinding protection. Attackers can exploit this vulnerability to send arbitrary requests to the local network and read the response. By crafting malicious URLs, an attacker can trick the application into making requests to internal resources that should not be accessible from the outside. This can lead to unauthorized access to sensitive information or even compromise the entire network if the targeted internal resource is vulnerable. The severity of this vulnerability is rated as MODERATE with a CVSS score of 5.5.

How To Fix

Minimum fixed version

2.1.17

This is the first release that contains the fix.

npm install link-preview-js@2.1.17

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Workaround

There is no known workaround for this vulnerability. It is essential to update to the fixed version of link-preview-js to mitigate the risk of SSRF attacks.

Conclusion

link-preview-js versions before 2.1.17 are vulnerable to Server-side Request Forgery (SSRF), which can lead to unauthorized access to internal resources and potential data leakage. To mitigate this vulnerability, it is recommended to upgrade to version 2.1.17 or later. For further support on vulnerability remediation, please contact DevNack.com.

See every vulnerability recorded for link-preview-js →

Share this vulnerability

FAQ

link-preview-js is an npm package that provides functionality for generating link previews. It allows users to extract metadata from URLs and display a preview of the linked content.

Server-side Request Forgery (SSRF) is a vulnerability that allows an attacker to make arbitrary requests from the server to internal resources. In the case of link-preview-js, it can be exploited to access sensitive information or compromise the network.

The potential consequences of this vulnerability include unauthorized access to internal resources, data leakage, and potential compromise of the entire network if the targeted internal resource is vulnerable.

To fix this vulnerability, you should upgrade to version 2.1.17 or later of link-preview-js. This version includes a fix for the flawed DNS rebinding protection.

There is no known workaround for this vulnerability. It is crucial to update to the fixed version of link-preview-js to mitigate the risk of SSRF attacks.

Related vulnerabilities

Recent vulnerabilities recorded for link-preview-js.

How To Fix

Minimum fixed version

2.1.17

This is the first release that contains the fix.

npm install link-preview-js@2.1.17

Tip — Not sure which version your app runs? Vulert can match this fix to it. Scan free →

Subscribe to Vulert on Telegram
Daily digest of new CVEs, critical and high severity, affected packages and fixes — plus a weekly roundup.
Join the channel →
Help improve this record
Report an issue or send feedback