Skip to content

webfinger.js Blind SSRF Vulnerability

Moderate severity GitHub Reviewed Published Jul 27, 2025 in silverbucket/webfinger.js • Updated Aug 1, 2025

Package

npm webfinger.js (npm)

Affected versions

<= 2.8.0

Patched versions

2.8.1

Description

Description

The lookup function takes a user address for checking accounts as a feature, however, as per
the ActivityPub spec (https://www.w3.org/TR/activitypub/#security-considerations), on the
security considerations section at B.3, access to Localhost services should be prevented while
running in production. The library does not prevent Localhost access (neither does it prevent
LAN addresses such as 192.168.x.x) , thus is not safe for use in production by ActivityPub
applications. The only check for localhost is done for selecting between HTTP and HTTPS
protocols, and it is done by testing for a host that starts with the string “localhost” and ends with
a port. Anything else (such as “127.0.0.1” or “localhost:1234/abc”) would not be considered
localhost for this test.

In addition, the way that the function determines the host, makes it possible to access any path
in the host, not only “/.well-known/...” paths:

if (address.indexOf('://') > -1) {
  // other uri format
  host = address.replace(/ /g,'').split('/')[2];
} else {
  // useraddress
  host = address.replace(/ /g,'').split('@')[1];
}

var uri_index = 0; // track which URIS we've tried already
var protocol = 'https'; // we use https by default

if (self.__isLocalhost(host)) {
  protocol = 'http';
}

function __buildURL() {
  var uri = '';
  if (! address.split('://')[1]) {
  // the URI has not been defined, default to acct
    uri = 'acct:';
  }
  return protocol + '://' + host + '/.well-known/' +URIS[uri_index] + '?resource=' + uri + address;
}

If the address is in the format of a user address ([email protected]), the host will be anything
after the first found @ symbol. Since no other test is done, an adversary may pass a specially
crafted address such as user@localhost:7000/admin/restricted_page? and reach pages that
would normally be out of reach. In this example, the code would treat
localhost:7000/admin/restricted_page? as the host, and the created URL would be
https://localhost:7000/admin/restricted_page?/.well-known/webfinger?resource=acct:use
r@localhost:7000/admin/restricted_page?. A server listening on localhost:7000 will then
parse the request as a GET request for the page /admin/restricted_page with the query string
/.well-known/webfinger?resource=acct:user@localhost:7000/admin/restricted_page?.

PoC and Steps to reproduce

This PoC assumes that there is a server on the machine listening on port 3000, which receives
requests for WebFinger lookups on the address /api/v1/search_user, and then calls the lookup
function in webfinger.js with the user passed as an argument. For the sake of the example we
assume that the server configured webfinger.js with tls_only=false.

  1. Activate a local HTTP server listening to port 1234 with a “secret.txt” file:
python3 -m http.server 1234
  1. Run the following command:
curl
"http://localhost:3000/api/v1/search_user?search=user@localhost:1234/secret.txt
?"
  1. View the console of the Python’s HTTP server and see that a request for a
    “secret.txt?/.well-known/webfinger?resource=acct:user@localhost:1234/secret.txt
    ?” file was performed.
    This proves that we can redirect the URL to any domain and path we choose, including
    localhost and the internal LAN.

Impact

Due to this issue, any user can cause a server using the library to send GET requests with
controlled host, path and port in an attempt to query services running on the instance’s host or
local network, and attempt to execute a Blind-SSRF gadget in hope of targeting a known
vulnerable local service running on the victim’s machine.

References

The vulnerability was discovered by Ori Hollander of the JFrog Vulnerability Research team.

References

@silverbucket silverbucket published to silverbucket/webfinger.js Jul 27, 2025
Published to the GitHub Advisory Database Jul 28, 2025
Reviewed Jul 28, 2025
Published by the National Vulnerability Database Aug 1, 2025
Last updated Aug 1, 2025

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v4 base metrics

Exploitability Metrics
Attack Vector Network
Attack Complexity Low
Attack Requirements None
Privileges Required None
User interaction None
Vulnerable System Impact Metrics
Confidentiality Low
Integrity None
Availability None
Subsequent System Impact Metrics
Confidentiality None
Integrity None
Availability None

CVSS v4 base metrics

Exploitability Metrics
Attack Vector: This metric reflects the context by which vulnerability exploitation is possible. This metric value (and consequently the resulting severity) will be larger the more remote (logically, and physically) an attacker can be in order to exploit the vulnerable system. The assumption is that the number of potential attackers for a vulnerability that could be exploited from across a network is larger than the number of potential attackers that could exploit a vulnerability requiring physical access to a device, and therefore warrants a greater severity.
Attack Complexity: This metric captures measurable actions that must be taken by the attacker to actively evade or circumvent existing built-in security-enhancing conditions in order to obtain a working exploit. These are conditions whose primary purpose is to increase security and/or increase exploit engineering complexity. A vulnerability exploitable without a target-specific variable has a lower complexity than a vulnerability that would require non-trivial customization. This metric is meant to capture security mechanisms utilized by the vulnerable system.
Attack Requirements: This metric captures the prerequisite deployment and execution conditions or variables of the vulnerable system that enable the attack. These differ from security-enhancing techniques/technologies (ref Attack Complexity) as the primary purpose of these conditions is not to explicitly mitigate attacks, but rather, emerge naturally as a consequence of the deployment and execution of the vulnerable system.
Privileges Required: This metric describes the level of privileges an attacker must possess prior to successfully exploiting the vulnerability. The method by which the attacker obtains privileged credentials prior to the attack (e.g., free trial accounts), is outside the scope of this metric. Generally, self-service provisioned accounts do not constitute a privilege requirement if the attacker can grant themselves privileges as part of the attack.
User interaction: This metric captures the requirement for a human user, other than the attacker, to participate in the successful compromise of the vulnerable system. This metric determines whether the vulnerability can be exploited solely at the will of the attacker, or whether a separate user (or user-initiated process) must participate in some manner.
Vulnerable System Impact Metrics
Confidentiality: This metric measures the impact to the confidentiality of the information managed by the VULNERABLE SYSTEM due to a successfully exploited vulnerability. Confidentiality refers to limiting information access and disclosure to only authorized users, as well as preventing access by, or disclosure to, unauthorized ones.
Integrity: This metric measures the impact to integrity of a successfully exploited vulnerability. Integrity refers to the trustworthiness and veracity of information. Integrity of the VULNERABLE SYSTEM is impacted when an attacker makes unauthorized modification of system data. Integrity is also impacted when a system user can repudiate critical actions taken in the context of the system (e.g. due to insufficient logging).
Availability: This metric measures the impact to the availability of the VULNERABLE SYSTEM resulting from a successfully exploited vulnerability. While the Confidentiality and Integrity impact metrics apply to the loss of confidentiality or integrity of data (e.g., information, files) used by the system, this metric refers to the loss of availability of the impacted system itself, such as a networked service (e.g., web, database, email). Since availability refers to the accessibility of information resources, attacks that consume network bandwidth, processor cycles, or disk space all impact the availability of a system.
Subsequent System Impact Metrics
Confidentiality: This metric measures the impact to the confidentiality of the information managed by the SUBSEQUENT SYSTEM due to a successfully exploited vulnerability. Confidentiality refers to limiting information access and disclosure to only authorized users, as well as preventing access by, or disclosure to, unauthorized ones.
Integrity: This metric measures the impact to integrity of a successfully exploited vulnerability. Integrity refers to the trustworthiness and veracity of information. Integrity of the SUBSEQUENT SYSTEM is impacted when an attacker makes unauthorized modification of system data. Integrity is also impacted when a system user can repudiate critical actions taken in the context of the system (e.g. due to insufficient logging).
Availability: This metric measures the impact to the availability of the SUBSEQUENT SYSTEM resulting from a successfully exploited vulnerability. While the Confidentiality and Integrity impact metrics apply to the loss of confidentiality or integrity of data (e.g., information, files) used by the system, this metric refers to the loss of availability of the impacted system itself, such as a networked service (e.g., web, database, email). Since availability refers to the accessibility of information resources, attacks that consume network bandwidth, processor cycles, or disk space all impact the availability of a system.
CVSS:4.0/AV:N/AC:L/AT:N/PR:N/UI:N/VC:L/VI:N/VA:N/SC:N/SI:N/SA:N

EPSS score

Weaknesses

Server-Side Request Forgery (SSRF)

The web server receives a URL or similar request from an upstream component and retrieves the contents of this URL, but it does not sufficiently ensure that the request is being sent to the expected destination. Learn more on MITRE.

CVE ID

CVE-2025-54590

GHSA ID

GHSA-8xq3-w9fx-74rv

Credits

Loading Checking history
See something to contribute? Suggest improvements for this vulnerability.