Skip to content

fix(scripts): fix escaping and shell commands #558

Closed

Description

@uniqueg

CodeQL reports two problems in the build scripts:

Wrong escaping order (js/double-escaping, alerts 5, 6, 7). scripts/tailwind/index.js escapes backticks first and backslashes second when it writes the generated CSS into a template literal. A backtick in the CSS therefore becomes two backslashes and a bare backtick, which ends the literal and breaks tw-styles.ts. ${ isn't escaped at all. Today's output has neither, so this doesn't affect current builds.

Commands built as shell strings (js/shell-command-injection-from-environment, alerts 1, 2, 3, 4). scripts/build.js and scripts/tailwind/index.js put absolute paths into shell command strings. A checkout path with a space or a shell metacharacter breaks the build (the tailwind and CEM config paths aren't even quoted), or runs part of the path as a command.

Fix: escape in the right order in one tested helper, and run the commands without a shell. The generated styles must stay byte-identical.

Activity

  1. added
    priority: medium
    type: bug
    type: security
    workload: hours
    on Nov 3, 2026
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

    priority: mediumtype: bugtype: securityworkload: hours

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions