@freelog/freelog-cli@0.1.11

Vulnerabilities

2 via 4 paths

Dependencies

335

Source

npm

Find, fix and prevent vulnerabilities in your code.

Severity
  • 1
  • 1
Status
  • 2
  • 0
  • 0

high severity

Server-side Request Forgery (SSRF)

  • Vulnerable module: netmask
  • Introduced through: urllib@2.25.4

Detailed paths

  • Introduced through: @freelog/freelog-cli@0.1.11 urllib@2.25.4 proxy-agent@2.3.1 pac-proxy-agent@2.0.2 pac-resolver@3.0.0 netmask@1.0.6
    Remediation: Upgrade to @freelog/freelog-cli@0.2.1.

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).

Remediation

Upgrade netmask to version 2.0.1 or higher.

References

medium severity

Arbitrary File Write via Archive Extraction (Zip Slip)

  • Vulnerable module: decompress-tar
  • Introduced through: download-git-repo@1.0.2

Detailed paths

  • Introduced through: @freelog/freelog-cli@0.1.11 download-git-repo@1.0.2 download@5.0.3 decompress@4.2.1 decompress-tar@4.1.1
  • Introduced through: @freelog/freelog-cli@0.1.11 download-git-repo@1.0.2 download@5.0.3 decompress@4.2.1 decompress-tarbz2@4.1.1 decompress-tar@4.1.1
  • Introduced through: @freelog/freelog-cli@0.1.11 download-git-repo@1.0.2 download@5.0.3 decompress@4.2.1 decompress-targz@4.1.1 decompress-tar@4.1.1

Overview

decompress-tar is a tar plugin for decompress.

Affected versions of this package are vulnerable to Arbitrary File Write via Archive Extraction (Zip Slip). It is possible to bypass the security measures provided by decompress and conduct ZIP path traversal through symlinks.

PoC

const decompress = require('decompress');

decompress('slip.tar.gz', 'dist').then(files => {
    console.log('done!');
});

Details

It is exploited using a specially crafted zip archive, that holds path traversal filenames. When exploited, a filename in a malicious archive is concatenated to the target extraction directory, which results in the final path ending up outside of the target folder. For instance, a zip may hold a file with a "../../file.exe" location and thus break out of the target folder. If an executable or a configuration file is overwritten with a file containing malicious code, the problem can turn into an arbitrary code execution issue quite easily.

The following is an example of a zip archive with one benign file and one malicious file. Extracting the malicous file will result in traversing out of the target folder, ending up in /root/.ssh/ overwriting the authorized_keys file:


+2018-04-15 22:04:29 ..... 19 19 good.txt

+2018-04-15 22:04:42 ..... 20 20 ../../../../../../root/.ssh/authorized_keys

Remediation

There is no fixed version for decompress-tar.

References