Vulnerabilities

3 via 5 paths

Dependencies

219

Source

GitHub

Find, fix and prevent vulnerabilities in your code.

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

high severity
new

Inefficient Algorithmic Complexity

  • Vulnerable module: js-yaml
  • Introduced through: gray-matter@4.0.3 and @grekt/engine@6.4.0

Detailed paths

  • Introduced through: @grekt/cli@grekt-labs/cli gray-matter@4.0.3 js-yaml@3.15.0
  • Introduced through: @grekt/cli@grekt-labs/cli @grekt/engine@6.4.0 gray-matter@4.0.3 js-yaml@3.15.0

Overview

js-yaml is a human-friendly data serialization language.

Affected versions of this package are vulnerable to Inefficient Algorithmic Complexity in the readFlowCollection function of parser.ts, which reaches exponential time when a flow sequence entry turns out to be a key: value pair and the parser rewinds to parse that entry a second time as the key. An attacker can exhaust CPU and block the Node event loop by supplying a small YAML document, under 200 bytes, with deeply nested flow sequences of key: value entries, since the re-parsing makes the work grow as O(2^n) in nesting depth. Exploitation occurs under the default configuration when the application parses untrusted YAML with load() or loadAll(), and needs no special schema, anchors, aliases, or merge keys.

Remediation

Upgrade js-yaml to version 5.2.2 or higher.

References

high severity
new

Directory Traversal

  • Vulnerable module: @hono/node-server
  • Introduced through: mcp-guardian@2.4.0

Detailed paths

  • Introduced through: @grekt/cli@grekt-labs/cli mcp-guardian@2.4.0 @modelcontextprotocol/sdk@1.29.0 @hono/node-server@1.19.15

Overview

@hono/node-server is a Node.js Adapter for Hono

Affected versions of this package are vulnerable to Directory Traversal in the serve-static on Windows hosts when an encoded backslash (%5C) in the request path is decoded to \, which the Windows path resolver treats as a separator. This allows an attacker to access static files under a middleware-guarded prefix by crafting a request path containing an encoded backslash. The attack remains within the configured root directory and does not allow escape outside the root.

Details

A Directory Traversal attack (also known as path traversal) aims to access files and directories that are stored outside the intended folder. By manipulating files with "dot-dot-slash (../)" sequences and its variations, or by using absolute file paths, it may be possible to access arbitrary files and directories stored on file system, including application source code, configuration, and other critical system files.

Directory Traversal vulnerabilities can be generally divided into two types:

  • Information Disclosure: Allows the attacker to gain information about the folder structure or read the contents of sensitive files on the system.

st is a module for serving static files on web pages, and contains a vulnerability of this type. In our example, we will serve files from the public route.

If an attacker requests the following URL from our server, it will in turn leak the sensitive private key of the root user.

curl http://localhost:8080/public/%2e%2e/%2e%2e/%2e%2e/%2e%2e/%2e%2e/root/.ssh/id_rsa

Note %2e is the URL encoded version of . (dot).

  • Writing arbitrary files: Allows the attacker to create or replace existing files. This type of vulnerability is also known as Zip-Slip.

One way to achieve this is by using a malicious zip archive that holds path traversal filenames. When each filename in the zip archive gets concatenated to the target extraction folder, without validation, the final path ends up outside 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 malicious 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

Upgrade @hono/node-server to version 2.0.5 or higher.

References

medium severity

Inefficient Algorithmic Complexity

  • Vulnerable module: js-yaml
  • Introduced through: gray-matter@4.0.3 and @grekt/engine@6.4.0

Detailed paths

  • Introduced through: @grekt/cli@grekt-labs/cli gray-matter@4.0.3 js-yaml@3.15.0
  • Introduced through: @grekt/cli@grekt-labs/cli @grekt/engine@6.4.0 gray-matter@4.0.3 js-yaml@3.15.0

Overview

js-yaml is a human-friendly data serialization language.

Affected versions of this package are vulnerable to Inefficient Algorithmic Complexity in the storeMappingPair() function in loader.js when handling repeated aliases in merge sequences. An attacker can exhaust CPU resources and significantly degrade service availability by submitting malicious YAML documents.

Remediation

Upgrade js-yaml to version 4.2.0 or higher.

References