Skip to content

agent new: generated post-script and validator echo untrusted values that can carry legacy ##[ workflow commands; locale default keeps LC_ALL=C #7949

Open

Description

@waynesun09

Summary

The review bot on fullsend-ai/agents#1167 flagged three issues in scripts that fullsend agent new generates. They are template-side, so they belong here: the agents example is kept byte-identical to generator output and won't be hand-edited. The two injection findings are as reported and haven't been reproduced on a runner yet.

Findings

  1. Rejected status printed with legacy workflow-command syntax intact (post.sh.tmpl, the invalid-status diagnostic). The rejected value is flattened (CR/LF) and capped at 40 characters, then printed after a fixed prefix. A model-written status such as ##[warning]forged or ##[add-mask]… survives that. The review says the Actions log parser recognizes the legacy ##[...] form anywhere in a line, so a fixed prefix doesn't neutralize it. The stop-commands fence from fix(#6966): keep model output in the generated post-script from issuing workflow commands #7914 covers only the dry-run preview, not this earlier path.
    • Suggested: log a fixed "invalid status" message without the value, or fence the diagnostic too. Add regression cases for ##[warning] and ##[add-mask].
  2. Validator echoes untrusted values (the generated validate-output-schema.sh, which prints e.message). A jsonschema enum error quotes the offending instance, so an invalid status of ##[warning]forged reaches the log through the validation loop's step output.
    • Suggested: emit errors from trusted field paths and the validator keyword only, without instance values, or fence the output. Add a validator regression case.
  3. LC_ALL defaulting keeps an inherited C/POSIX locale (post.sh.tmpl: export LC_ALL="${LC_ALL:-C.UTF-8}"). If the runner already sets LC_ALL=C, bash counts bytes. A 101-character é… summary then fails the 200-character check that the schema allows, and truncation can split a UTF-8 character.
    • Suggested: force a UTF-8 locale for the length and truncation steps regardless of what's inherited. Add multibyte tests under LC_ALL=C.

Once fixed, regenerate examples/link-check/ in fullsend-ai/agents.

Related: the review's breadth note on the generated Vertex profile (*.googleapis.com read-write) is scaffold-vs-fleet drift already tracked in #6978.

Activity

  1. fullsend-ai-triage commented on Oct 1, 2026

    @fullsend-ai-triage

    🤖 Finished Triage · ✅ Success · Started 10:39 PM UTC · Completed 10:42 PM UTC

    Commit: d3540e2 · View workflow run →

    Runtime: claude · Model: sonnet → claude-sonnet-5 · Effort: high · Cost: $0.50

  2. added
    type/bug
    security
    component/harness
    priority/high
    ready-to-code
    on Oct 1, 2026
  3. fullsend-ai-triage commented on Oct 1, 2026

    @fullsend-ai-triage

    Verified all three findings directly against the templates at HEAD:

    • post.sh.tmpl's invalid-status diagnostic flattens CR/LF and caps at 40 chars, but a ##[...]-style token survives that treatment. This repo's own internal/cli/run.go already recognizes ##[error] as a legacy Actions logging-command form elsewhere, which corroborates the reported risk.
    • The generated validate-output-schema.sh prints e.message from a Python jsonschema.ValidationError verbatim; for an enum violation that embeds the offending instance value, so the same class of untrusted string reaches step output through this separate path.
    • post.sh.tmpl sets LC_ALL="${LC_ALL:-C.UTF-8}", which only applies when LC_ALL is unset — an inherited LC_ALL=C passes through untouched, so ${#summary} counts bytes rather than Unicode code points against the schema's 200-codepoint cap.

    No open PR currently addresses this issue (checked by issue-number search, by filename search, and via GitHub's closing-PR references). Of the two related items the issue mentions: PR #7914 (merged) hardened only the dry-run preview path, consistent with the reporter's claim that it doesn't cover the status-diagnostic path; issue #6978 is unrelated drift already tracked separately, not a blocker here. Severity is rated high given the security-adjacent (log/workflow-command injection) nature of two of the three findings, tempered by the reporter's own note that the injection findings haven't yet been reproduced on a live runner.

    Once merged, examples/link-check/ in fullsend-ai/agents will need regenerating, per the issue.


    Labels: This is a confirmed template-side defect with a security (workflow-command/log injection) dimension in agent-scaffolding code, matching this repo's convention of pairing type/bug and bug with security and component/harness, and priority/high for similar confirmed scaffold defects (#7014, #7567).


    Next steps:

    • /fs-code — agent creates a PR to implement this issue
    • /fs-code <your instruction> — agent implements with your specific guidance
  4. fullsend-ai-coder commented on Oct 1, 2026

    @fullsend-ai-coder
    Contributor

    🤖 Finished Code · ✅ Success · Started 10:44 PM UTC · Completed 10:59 PM UTC

    Commit: d3540e2 · View workflow run →

    Runtime: claude · Model: sonnet → claude-sonnet-5 · Effort: high · Cost: $3.62

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

    bugcomponent/harnesspriority/highready-to-codesecuritytype/bug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions