Skip to content

Update js-yaml dependency from ^3.13.1 to ^4.x (security: GHSA-h67p-54hq-rp68) #12174

Closed
podman-desktop/podman-desktop
#18069

Description

@Vladyslav-Chychykalo

Have you read the Contributing Guidelines on issues?

Prerequisites

Description

Problem

moderate DoS vulnerability (GHSA-h67p-54hq-rp68).

The fix exists in js-yaml 4.2.0+, but upgrading is blocked because
gray-matter uses the removed yaml.safeLoad() API (removed in js-yaml 4.x).

Suggested fix

  1. Update package.json: "js-yaml": "^4.2.0"
  2. Update lib/parse.js: replace yaml.safeLoad(...) → yaml.load(...)
    (it is safe by default in 4.x)

References

Reproducible demo

No response

Steps to reproduce

  1. Create a Docusaurus project
  2. Run npm audit

Expected behavior

No vulnerabilities reported for js-yaml

Actual behavior

js-yaml <=4.1.1 flagged as vulnerable (GHSA-h67p-54hq-rp68, moderate DoS).
Root cause: @docusaurus/utils → [email protected] → js-yaml@^3.13.1. gray-matter uses removed yaml.safeLoad() API so it cannot be upgraded to js-yaml 4.x via npm overrides without breaking the docs build.

Your environment

  • Docusaurus version: 3.10.1
  • Node.js: 24.x
  • OS: macOS 24.4.0

Self-service

  • I'd be willing to fix this bug myself.

Activity

  1. added
    bug
    status: needs triage
    on Jun 17, 2026
  2. removed
    status: needs triage
    on Jun 18, 2026
  3. slorber commented on Jun 18, 2026

    @slorber
    Collaborator

    I know this is not what you want to hear, but Docusaurus v3 is not really affected by this vulnerability. Front Matter is parsed from MDX docs, which should be treated as unsafe code, and changes should be carefully reviewed before merging.

    If you allow malicious inputs in MDX files, you have a bigger problem than DOS because the attacker can run arbitrary code on your dev machine/server, including DOS payloads.


    Unfortunately, gray-matter is unmaintained and will likely not merge a fix: jonschlinkert/gray-matter#189

    Fortunately, there's a slimmer fork of it we could use. I'll have to see if it's retrocompatible enough and could be backported to v3.
    https://github.com/11ty/gray-matter

  4. Vladyslav-Chychykalo commented on Jun 19, 2026

    @Vladyslav-Chychykalo
    Author

    @slorber Great, it works, thank you!

  5. tats-u commented on Jun 26, 2026

    @tats-u
    Contributor

    FYI, for those annoyed with GHSA and using pnpm:

    overrides:
      gray-matter@^4: npm:@11ty/gray-matter@^2.1.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions