Vulnerabilities in pkg:npm/ssrf-agent

PACKAGE
Advisory Identifier: GHSA-6gww-qpm6-mc2g
Advisory Summary

CVE-2021-23718 is a MODERATE (CVSS 6.5) server-side request forgery vulnerability (CWE-918: Server-Side Request Forgery (SSRF)) affecting Ssrf agent libraries in the npm ecosystem. The issue involves server-side request forgery in ssrf-agent. Remediation is available by upgrading affected packages to version 1.0.5.

1 Known Advisory Record(s)
Package Vulnerability Intelligence

pkg:npm/ssrf-agent

1 Known Advisory Record(s)

Vulnerability advisories affecting package pkg:npm/ssrf-agent. Select an advisory below to view technical details or fixes.

Advisory ID CVE / NVD Severity Summary
GHSA-6gww-qpm6-mc2g CVE-2021-23718 MODERATE Server-Side Request Forgery in ssrf-agent

CVE-2021-23718 at a Glance

CVE Identifier CVE-2021-23718
GHSA Identifier GHSA-6gww-qpm6-mc2g
Severity MODERATE
CVSS v3.1 Base Score 6.5
CWE Classification CWE-918: Server-Side Request Forgery (SSRF)
Affected Product Ssrf agent
Package Ecosystem npm
Published Date
Last Updated

Security Impact

CVSS: 6.5

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction Required (UI:R)
Scope Unchanged (S:U)
Confidentiality High (C:H)
Integrity None (I:N)
Availability None (A:N)

How to Fix CVE-2021-23718

To remediate this vulnerability, upgrade all affected Ssrf agent dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

ssrf-agent fixed: 1.0.5
npm install ssrf-agent@1.0.5
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

npm ls ssrf-agent

How to Check if You Are Affected

To determine whether your Node.js application is affected by CVE-2021-23718, inspect your project dependencies using npm:

npm ls ssrf-agent

Analyze the terminal output to locate any version of Ssrf agent in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 1.0.5), your application is affected.

Note: The npm ls ssrf-agent command inspects dependencies declared in your package.json and lockfile; it does not perform automated runtime dynamic scanning.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-918: Server-Side Request Forgery (SSRF), where 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. In Ssrf agent, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

The package ssrf-agent before 1.0.5 are vulnerable to Server-side Request Forgery (SSRF) via the defaultIpChecker function. It fails to properly validate if the IP requested is private.

CVE-2021-23718 Affected Ssrf agent Versions

1 component(s)
Fixed Versions:
1.0.5
Product / Package Ecosystem Affected Versions Fixed Version
ssrf-agent
npm
< 1.0.5
1.0.5

References

Frequently Asked Questions

What is CVE-2021-23718?
CVE-2021-23718 is a security vulnerability in Ssrf agent involving Server-Side Request Forgery in ssrf-agent under CWE-918: Server-Side Request Forgery (SSRF).
Which Ssrf agent versions are affected?
Affected versions include releases prior to 1.0.5 across affected packages: ssrf-agent.
What version fixes CVE-2021-23718?
Upgrading to 1.0.5 (or the latest patched release for your respective branch) resolves the vulnerability.
Is ssrf-agent affected?
Yes, ssrf-agent is affected in releases prior to 1.0.5. Upgrade your dependency to 1.0.5 or later.
What is the CVSS score of CVE-2021-23718?
CVE-2021-23718 has a CVSS v3.1 base score of 6.5 (MODERATE) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N.
What CWE is associated with CVE-2021-23718?
CVE-2021-23718 is classified under CWE-918: 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.).
How can I check npm dependencies for CVE-2021-23718?
Run the dependency tree command: 'npm ls ssrf-agent'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-6gww-qpm6-mc2g",
  "modified" : "2021-11-29T15:08:38Z",
  "published" : "2021-12-02T17:51:51Z",
  "aliases" : [ "CVE-2021-23718" ],
  "summary" : "Server-Side Request Forgery in ssrf-agent",
  "details" : "The package ssrf-agent before 1.0.5 are vulnerable to Server-side Request Forgery (SSRF) via the defaultIpChecker function. It fails to properly validate if the IP requested is private.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:N/A:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "npm",
      "name" : "ssrf-agent"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "1.0.5"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-23718"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/welefen/ssrf-agent/commit/9607175acd0647d821bae4e8fcc3b712aca3fd2d#diff-e727e4bdf3657fd1d798edcd6b099d6e092f8573cba266154583a746bba0f346"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/welefen/ssrf-agent"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/welefen/ssrf-agent/blob/cec2b85fe8886ad6926a247a3e059d8369ec022b/index.js%23L13"
  }, {
    "type" : "WEB",
    "url" : "https://security.netapp.com/advisory/ntap-20211203-0005"
  }, {
    "type" : "WEB",
    "url" : "https://snyk.io/vuln/SNYK-JS-SSRFAGENT-1584362"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-918" ],
    "severity" : "MODERATE",
    "github_reviewed" : true,
    "github_reviewed_at" : "2021-11-23T19:15:40Z",
    "nvd_published_at" : "2021-11-22T17:15:00Z"
  }
}