Vulnerabilities

8 via 8 paths

Dependencies

36

Source

GitHub

Find, fix and prevent vulnerabilities in your code.

Issue type
  • 8
  • 1
Severity
  • 2
  • 1
  • 6
Status
  • 9
  • 0
  • 0

critical severity
new

Command Injection

  • Vulnerable module: shescape
  • Introduced through: shescape@2.1.6

Detailed paths

  • Introduced through: @snyk/snyk-cocoapods-plugin@snyk/snyk-cocoapods-plugin shescape@2.1.6
    Remediation: Upgrade to shescape@2.1.14.

Overview

shescape is a simple shell escape library

Affected versions of this package are vulnerable to Command Injection via the getEscapeFunction function when using the escape or escapeAll APIs on Windows with shell set to cmd.exe, or with shell set to true when CMD is the default. An attacker can execute arbitrary commands by supplying specially crafted arguments that break out of a parenthesized CMD construct and inject shell syntax.

Remediation

Upgrade shescape to version 2.1.14, 3.0.1 or higher.

References

critical severity
new

Improper Neutralization

  • Vulnerable module: shescape
  • Introduced through: shescape@2.1.6

Detailed paths

  • Introduced through: @snyk/snyk-cocoapods-plugin@snyk/snyk-cocoapods-plugin shescape@2.1.6
    Remediation: Upgrade to shescape@2.1.14.

Overview

shescape is a simple shell escape library

Affected versions of this package are vulnerable to Improper Neutralization via the escape or escapeAll APIs when processing untrusted input containing parentheses on Windows systems configured to use CMD as the shell. An attacker can execute arbitrary commands by injecting specially crafted input that is not properly escaped. This is only exploitable if the application is running on Windows and explicitly configures the shell to CMD or relies on CMD as the default shell.

Workaround

This vulnerability can be mitigated by removing all instances of ( and ) from untrusted inputs.

Remediation

Upgrade shescape to version 2.1.14, 3.0.1 or higher.

References

high severity
new

Improper Encoding or Escaping of Output

  • Vulnerable module: shescape
  • Introduced through: shescape@2.1.6

Detailed paths

  • Introduced through: @snyk/snyk-cocoapods-plugin@snyk/snyk-cocoapods-plugin shescape@2.1.6
    Remediation: Upgrade to shescape@2.1.14.

Overview

shescape is a simple shell escape library

Affected versions of this package are vulnerable to Improper Encoding or Escaping of Output via improper escaping in the getEscapeFunction function. An attacker can access sensitive home-directory information and potentially alter the target location of commands by supplying crafted input such as :~ when the escape or escapeAll APIs are used on Unix systems with the shell set to dash, or with shell set to true when Dash is the default, and the result is interpolated into an assignment prefixed to a command.

Remediation

Upgrade shescape to version 2.1.14, 3.0.1 or higher.

References

medium severity

Improper Encoding or Escaping of Output

  • Vulnerable module: shescape
  • Introduced through: shescape@2.1.6

Detailed paths

  • Introduced through: @snyk/snyk-cocoapods-plugin@snyk/snyk-cocoapods-plugin shescape@2.1.6
    Remediation: Upgrade to shescape@2.1.10.

Overview

shescape is a simple shell escape library

Affected versions of this package are vulnerable to Improper Encoding or Escaping of Output in the escape function. An attacker can cause unintended expansion of shell arguments by supplying input containing square brackets, which may result in multiple filesystem matches being processed instead of a single literal argument. This can lead to changes in command behavior, targeting of unintended files, or exposure of filenames when the output is used in shell commands.

PoC

tmp=$(mktemp -d)
cd "$tmp"
npm pack shescape@2.1.9 >/dev/null
mkdir pkg
tar -xzf shescape-2.1.9.tgz -C pkg
cd pkg/package
npm install --omit=dev

node --input-type=module - <<'NODE'
import { mkdtempSync, writeFileSync } from "node:fs";
import { tmpdir } from "node:os";
import path from "node:path";
import { execSync } from "node:child_process";
import { Shescape } from "./src/index.js";

const dir = mkdtempSync(path.join(tmpdir(), "shescape-ghsa-poc-"));
writeFileSync(path.join(dir, "secret1"), "");
writeFileSync(path.join(dir, "secret2"), "");

for (const shell of ["/usr/bin/bash", "/usr/bin/dash"]) {
  const shescape = new Shescape({ shell });
  const escaped = shescape.escape("secret[12]");
  console.log(${shell} escaped=${escaped});
  const out = execSync(printf '<%s>\\n' ${escaped}, { cwd: dir, shell }).toString();
  process.stdout.write(out);
}
NODE

Remediation

Upgrade shescape to version 2.1.10 or higher.

References

medium severity
new

Command Injection

  • Vulnerable module: shescape
  • Introduced through: shescape@2.1.6

Detailed paths

  • Introduced through: @snyk/snyk-cocoapods-plugin@snyk/snyk-cocoapods-plugin shescape@2.1.6
    Remediation: Upgrade to shescape@2.1.14.

Overview

shescape is a simple shell escape library

Affected versions of this package are vulnerable to Command Injection in the escape and escapeAll functions when used on Unix systems with the shell explicitly configured to Zsh, or when the default shell is Zsh. An attacker can obtain lists of files and directories on the system by leveraging home directory expansion and extended glob syntax.

Note: This is only exploitable if the shell is set to Zsh and the Zsh options EXTENDED_GLOB and MAGIC_EQUAL_SUBST are enabled.

Remediation

Upgrade shescape to version 2.1.14, 3.0.1 or higher.

References

medium severity
new

Improper Encoding or Escaping of Output

  • Vulnerable module: shescape
  • Introduced through: shescape@2.1.6

Detailed paths

  • Introduced through: @snyk/snyk-cocoapods-plugin@snyk/snyk-cocoapods-plugin shescape@2.1.6
    Remediation: Upgrade to shescape@2.1.14.

Overview

shescape is a simple shell escape library

Affected versions of this package are vulnerable to Improper Encoding or Escaping of Output in the escape or escapeAll process when used with the shell option set to Dash or when the default shell is Dash. An attacker can obtain the user's home directory and potentially influence the location on which a command operates by supplying specially crafted input containing ~ characters. This is only exploitable if the application explicitly configures the shell option to Dash or relies on Dash as the default shell in assignment contexts.

Workaround

This vulnerability can be mitigated by refraining from using Dash, using the env option of the node:child_process API to inject variables with untrusted values, or removing all instances of ~ from untrusted inputs.

Remediation

Upgrade shescape to version 2.1.14, 3.0.1 or higher.

References

medium severity
new

Improper Encoding or Escaping of Output

  • Vulnerable module: shescape
  • Introduced through: shescape@2.1.6

Detailed paths

  • Introduced through: @snyk/snyk-cocoapods-plugin@snyk/snyk-cocoapods-plugin shescape@2.1.6
    Remediation: Upgrade to shescape@2.1.15.

Overview

shescape is a simple shell escape library

Affected versions of this package are vulnerable to Improper Encoding or Escaping of Output via the getEscapeFunction logic in src/internal/unix/busybox.js. An attacker can reveal the user's home directory and alter how a command interprets an assignment-prefixed value by supplying input such as :~ or a=~ to escape or escapeAll when Unix shell escaping targets BusyBox sh. On affected Unix systems where shell is set to "sh" or true and /bin/sh points to BusyBox, the escaped tilde is expanded in assignment contexts instead of being treated as data, causing commands like V=...; echo $V to print : followed by the home path.

Remediation

Upgrade shescape to version 2.1.15, 3.0.2 or higher.

References

medium severity
new

Improper Neutralization

  • Vulnerable module: shescape
  • Introduced through: shescape@2.1.6

Detailed paths

  • Introduced through: @snyk/snyk-cocoapods-plugin@snyk/snyk-cocoapods-plugin shescape@2.1.6
    Remediation: Upgrade to shescape@2.1.14.

Overview

shescape is a simple shell escape library

Affected versions of this package are vulnerable to Improper Neutralization in the escape or escapeAll process when used with Zsh as the shell, especially if the Zsh options EXTENDED_GLOB or MAGIC_EQUAL_SUBST are enabled. An attacker can obtain sensitive information about files and directories by supplying crafted input that leverages home directory expansion or extended glob syntax. This is only exploitable if the application is configured to use Zsh as the shell and the relevant Zsh options are enabled.

Workaround

This vulnerability can be mitigated by refraining from using Zsh, disabling the EXTENDED_GLOB option, or removing all instances of ^, #, and ~ from untrusted inputs.

Remediation

Upgrade shescape to version 2.1.14, 3.0.1 or higher.

References

medium severity

MPL-2.0 license

  • Module: shescape
  • Introduced through: shescape@2.1.6

Detailed paths

  • Introduced through: @snyk/snyk-cocoapods-plugin@snyk/snyk-cocoapods-plugin shescape@2.1.6

MPL-2.0 license