Vulnerabilities

5 via 8 paths

Dependencies

101

Source

GitHub

Commit

1c25f59a

Find, fix and prevent vulnerabilities in your code.

Severity
  • 4
  • 1
Status
  • 5
  • 0
  • 0

high severity

Server-side Request Forgery (SSRF)

  • Vulnerable module: ip
  • Introduced through: mailgun-js@0.22.0

Detailed paths

  • Introduced through: moleculer-mailgun@YourSoftRun/moleculer-mailgun#1c25f59a156b00f1df4c6ad3ba66252e9be4d197 mailgun-js@0.22.0 proxy-agent@3.1.1 socks-proxy-agent@4.0.2 socks@2.3.3 ip@1.1.5
  • Introduced through: moleculer-mailgun@YourSoftRun/moleculer-mailgun#1c25f59a156b00f1df4c6ad3ba66252e9be4d197 mailgun-js@0.22.0 proxy-agent@3.1.1 pac-proxy-agent@3.0.1 socks-proxy-agent@4.0.2 socks@2.3.3 ip@1.1.5

Overview

ip is a Node library.

Affected versions of this package are vulnerable to Server-side Request Forgery (SSRF) via the isPublic function, by failing to identify hex-encoded 0x7f.1 as equivalent to the private addess 127.0.0.1. An attacker can expose sensitive information, interact with internal services, or exploit other vulnerabilities within the network by exploiting this vulnerability.

PoC

var ip = require('ip');

console.log(ip.isPublic("0x7f.1"));
//This returns true. It should be false because 0x7f.1 == 127.0.0.1 == 0177.1

Remediation

Upgrade ip to version 1.1.9, 2.0.1 or higher.

References

high severity

Remote Code Execution (RCE)

  • Vulnerable module: pac-resolver
  • Introduced through: mailgun-js@0.22.0

Detailed paths

  • Introduced through: moleculer-mailgun@YourSoftRun/moleculer-mailgun#1c25f59a156b00f1df4c6ad3ba66252e9be4d197 mailgun-js@0.22.0 proxy-agent@3.1.1 pac-proxy-agent@3.0.1 pac-resolver@3.0.0

Overview

Affected versions of this package are vulnerable to Remote Code Execution (RCE). This can occur when used with untrusted input, due to unsafe PAC file handling.

In order to exploit this vulnerability in practice, this either requires an attacker on your local network, a specific vulnerable configuration, or some second vulnerability that allows an attacker to set your config values.

NOTE: The fix for this vulnerability is applied in the node-degenerator library, a dependency is written by the same maintainer.

PoC

const pac = require('pac-resolver');

// Should keep running forever (if not vulnerable):
setInterval(() => {
    console.log("Still running");
}, 1000);

// Parsing a malicious PAC file unexpectedly executes unsandboxed code:
pac(`
    // Real PAC config:
    function FindProxyForURL(url, host) {
        return "DIRECT";
    }

    // But also run arbitrary code:
    var f = this.constructor.constructor(\`
        // Running outside the sandbox:
        console.log('Read env vars:', process.env);
        console.log('!!! PAC file is running arbitrary code !!!');
        console.log('Can read & could exfiltrate env vars ^');
        console.log('Can kill parsing process, like so:');
        process.exit(100); // Kill the vulnerable process
        // etc etc
    \`);

    f();

Remediation

Upgrade pac-resolver to version 5.0.0 or higher.

References

high severity

Server-side Request Forgery (SSRF)

  • Vulnerable module: netmask
  • Introduced through: mailgun-js@0.22.0

Detailed paths

  • Introduced through: moleculer-mailgun@YourSoftRun/moleculer-mailgun#1c25f59a156b00f1df4c6ad3ba66252e9be4d197 mailgun-js@0.22.0 proxy-agent@3.1.1 pac-proxy-agent@3.0.1 pac-resolver@3.0.0 netmask@1.0.6

Overview

netmask is a library to parse IPv4 CIDR blocks.

Affected versions of this package are vulnerable to Server-side Request Forgery (SSRF). It incorrectly evaluates individual IPv4 octets that contain octal strings as left-stripped integers, leading to an inordinate attack surface on hundreds of thousands of projects that rely on netmask to filter or evaluate IPv4 block ranges, both inbound and outbound.

For example, a remote unauthenticated attacker can request local resources using input data 0177.0.0.1 (127.0.0.1), which netmask evaluates as the public IP 177.0.0.1. Contrastingly, a remote authenticated or unauthenticated attacker can input the data 0127.0.0.01 (87.0.0.1) as localhost, yet the input data is a public IP and can potentially cause local and remote file inclusion (LFI/RFI). A remote authenticated or unauthenticated attacker can bypass packages that rely on netmask to filter IP address blocks to reach intranets, VPNs, containers, adjacent VPC instances, or LAN hosts, using input data such as 012.0.0.1 (10.0.0.1), which netmask evaluates as 12.0.0.1 (public).

NOTE: This vulnerability has also been identified as: CVE-2021-29418

Remediation

Upgrade netmask to version 2.0.1 or higher.

References

high severity

Server-side Request Forgery (SSRF)

  • Vulnerable module: netmask
  • Introduced through: mailgun-js@0.22.0

Detailed paths

  • Introduced through: moleculer-mailgun@YourSoftRun/moleculer-mailgun#1c25f59a156b00f1df4c6ad3ba66252e9be4d197 mailgun-js@0.22.0 proxy-agent@3.1.1 pac-proxy-agent@3.0.1 pac-resolver@3.0.0 netmask@1.0.6

Overview

netmask is a library to parse IPv4 CIDR blocks.

Affected versions of this package are vulnerable to Server-side Request Forgery (SSRF). It incorrectly evaluates individual IPv4 octets that contain octal strings as left-stripped integers, leading to an inordinate attack surface on hundreds of thousands of projects that rely on netmask to filter or evaluate IPv4 block ranges, both inbound and outbound.

For example, a remote unauthenticated attacker can request local resources using input data 0177.0.0.1 (127.0.0.1), which netmask evaluates as the public IP 177.0.0.1. Contrastingly, a remote authenticated or unauthenticated attacker can input the data 0127.0.0.01 (87.0.0.1) as localhost, yet the input data is a public IP and can potentially cause local and remote file inclusion (LFI/RFI). A remote authenticated or unauthenticated attacker can bypass packages that rely on netmask to filter IP address blocks to reach intranets, VPNs, containers, adjacent VPC instances, or LAN hosts, using input data such as 012.0.0.1 (10.0.0.1), which netmask evaluates as 12.0.0.1 (public).

NOTE: This vulnerability has also been identified as: CVE-2021-28918

Remediation

Upgrade netmask to version 2.0.1 or higher.

References

medium severity

Server-Side Request Forgery (SSRF)

  • Vulnerable module: ip
  • Introduced through: mailgun-js@0.22.0

Detailed paths

  • Introduced through: moleculer-mailgun@YourSoftRun/moleculer-mailgun#1c25f59a156b00f1df4c6ad3ba66252e9be4d197 mailgun-js@0.22.0 proxy-agent@3.1.1 pac-proxy-agent@3.0.1 pac-resolver@3.0.0 ip@1.1.9
  • Introduced through: moleculer-mailgun@YourSoftRun/moleculer-mailgun#1c25f59a156b00f1df4c6ad3ba66252e9be4d197 mailgun-js@0.22.0 proxy-agent@3.1.1 socks-proxy-agent@4.0.2 socks@2.3.3 ip@1.1.5
  • Introduced through: moleculer-mailgun@YourSoftRun/moleculer-mailgun#1c25f59a156b00f1df4c6ad3ba66252e9be4d197 mailgun-js@0.22.0 proxy-agent@3.1.1 pac-proxy-agent@3.0.1 socks-proxy-agent@4.0.2 socks@2.3.3 ip@1.1.5

Overview

ip is a Node library.

Affected versions of this package are vulnerable to Server-Side Request Forgery (SSRF) via the isPublic function, which identifies some private IP addresses as public addresses due to improper parsing of the input. An attacker can manipulate a system that uses isLoopback(), isPrivate() and isPublic functions to guard outgoing network requests to treat certain IP addresses as globally routable by supplying specially crafted IP addresses.

Note

This vulnerability derived from an incomplete fix for CVE-2023-42282

Remediation

There is no fixed version for ip.

References