Skip to content

[BUG]: Security scan mistakes RegExp.exec(output) for untrusted code execution #31

Closed

Description

@Patrick-Erichsen

What happened?

Running the Tier 1 security check against the public openclaw/agent-skills session-viewer skill reports a high-severity “Unvalidated Output Injection (OH1)” finding:

Security Scan — Output Handling: exec(output
File: scripts/importers/codex.ts:24

The matched code is:

function statusFromOutput(output: string): "ok" | "error" | "unknown" {
  const match = /Process exited with code\s+(-?\d+)/u.exec(output);

This is RegExp.prototype.exec, which only parses a string. It does not execute output, invoke a shell, or inject the value into another context.

Expected: regex calls such as /.../.exec(output) are not classified as output injection.

Actual: validation fails with a high-severity OH1 finding.

Reproduction steps

tmp="$(mktemp -d)"
git clone --depth 1 https://github.com/NVIDIA/SkillEvaluator.git "$tmp/SkillEvaluator"
git clone --depth 1 https://github.com/openclaw/agent-skills.git "$tmp/agent-skills"
cd "$tmp/SkillEvaluator"
uv sync --python 3.13 --all-extras
uv run skillevaluator validate \
  "$tmp/agent-skills/skills/session-viewer" \
  --checks security \
  --no-dedup \
  --report cli

The final command exits 1 and reports:

[SECURITY-HIGH] Output Handling: exec(output
Check: Unvalidated Output Injection (OH1)

Skill Evaluator version or commit

cd128302d745b421bfaa02a1335fac30f21344e7

The tested openclaw/agent-skills commit was 2a409d348a4bcf6f15e41e9a20efd0b298a32528.

Environment

  • macOS 26.4, arm64
  • Python 3.13.14
  • uv 0.11.6
  • Installed from the public source checkout with uv sync --python 3.13 --all-extras
  • No provider or agent configuration is needed for this Tier 1 reproduction

Before submitting

Activity

  1. chrisknvidia commented on Aug 7, 2026

    @chrisknvidia
    Collaborator

    Thanks for reporting this. The false positive originated in SkillSpector’s output-handling rule. We implemented the requested fix in NVIDIA/SkillSpector#341, and that PR has now been merged.

    The fix narrowly treats unambiguous JavaScript/TypeScript RegExp literal .exec(...) calls as parsing while retaining OH1 findings for actual or ambiguous execution sinks. The original SkillEvaluator reproduction now passes with the corrected SkillSpector behavior.

    @Patrick-Erichsen, could you please confirm whether this resolves the issue on your side? If so, may we close this issue?

  2. chrisknvidia commented on Aug 17, 2026

    @chrisknvidia
    Collaborator

    Closing the ticket since the issue is resolved and update is shared.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions