Skip to content

post-failure-report: _sanitize_workflow_value can rebuild :: from split input #2164

Not planned

Description

@waynesun09

Problem

_sanitize_workflow_value in scripts/lib/post-failure-report.lib.sh removes :: first and the encoded newlines (%0A, %0D) after. Removing one sequence can therefore create another: :%0A:error:%0A:injected becomes ::error::injected.

Every caller is affected, including print_sanitized_gha_log. Impact is limited to fake annotations or log grouping, and only when attacker-influenced text reaches the log.

Found by the review agent on #2010 (thread on scripts/post-code.src.sh); the helper is unchanged by that PR.

Scope

  • scripts/lib/post-failure-report.lib.sh: strip the encoded CR/LF before ::, or repeat the replacements until the value stops changing.
  • Rebuild the bundles that include the library (make script-build).
  • Add regression cases to scripts/post-failure-report-test.sh for split delimiters such as :%0A:error:%0A:x and %0%0AA.

Acceptance

  • No input produces :: or an encoded newline after sanitizing.
  • make check-bundle and scripts/post-failure-report-test.sh pass.

Activity

  1. added
    bug
    on Nov 23, 2026
  2. fullsend-ai-triage commented on Nov 23, 2026

    @fullsend-ai-triage

    🤖 Finished Triage · ✅ Success · Started 5:46 PM UTC · Completed 5:48 PM UTC

    Commit: a4d3b9f · View workflow run →

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

  3. added
    ready-to-code
    on Nov 23, 2026
  4. fullsend-ai-triage commented on Nov 23, 2026

    @fullsend-ai-triage

    Confirmed against the current code: _sanitize_workflow_value uses single-pass substitutions, so the result can still contain :: or an encoded newline.

    Additional finding: reordering alone is not enough. If encoded newlines are stripped first, an input like %0::A becomes %0A after the :: removal. Iterating all replacements until the value is stable (the issue's second option) is the safe fix.

    Also worth checking: sanitize_comment_workflow_commands in the same library strips %0A/%0D in single passes, so it may have a similar splice. That is outside this issue's stated scope, so the fix can note it or leave it for a follow-up.

    Bundles: the function is copied into post-code.sh, post-fix.sh and validate-code-output.sh. After editing the library, run make script-build and then make check-bundle.

    No open PR or duplicate issue was found.

    Proposed test case:

    for input in ':%0A:error:%0A:x' '%0%0AA' '%0::A' ':%0a:' ':%0D:' '::%0A::':
      out = _sanitize_workflow_value(input)
      assert out does not contain '::'
      assert out does not contain %0A, %0a, %0D or %0d
    assert _sanitize_workflow_value('123') == '123'
    

    Next steps:

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

    @fullsend-ai-coder
    Contributor

    🤖 Finished Code · ✅ Success · Started 5:50 PM UTC · Completed 5:58 PM UTC

    Commit: a4d3b9f · View workflow run →

    Runtime: claude · Model: opus → claude-opus-5-5 · Effort: high · Cost: $0.94

  6. tpouyer commented on Nov 25, 2026

    @tpouyer
    Contributor

    Closing as abandoned: work on this issue was stopped and will not continue in this change.

    Reason: #2165 (the coder bot) already fixes it

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

    bugready-to-code

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions