Skip to content

compliance-audit.sh close_resolved_issues matches check IDs as a regex and treats grep errors as resolved #1401

Closed

Description

@don-petry

The closer interprets a repository-derived check identifier as a regular expression instead of comparing it literally. It treats every nonzero grep result, including an invalid-expression error, as proof that the finding disappeared and closes the issue.

Location: scripts/compliance-audit.sh:3239
Severity: low · Rule: CWE-185 · Reachability: external
Subsystem: Organization administration and standards deployment

Evidence

  • Source/control: A workflow filename incorporated into an unpinned-actions finding and its generated issue title.
  • Sink/decision: The regex-based resolution decision controlling gh issue close.
  • Missing mitigation: The resolution check does not use literal identifier matching and does not distinguish an evaluation error from a definite no-match result.

Assumptions
Based on these assumptions: A2 (Attacker-controlled input): A contributor can supply a workflow filename and unpinned-action content on the branch read by the organization audit.
Findings that rely on assumptions are published at medium severity at most. If an assumption does not hold for your deployment, dismiss this finding.

Reachability call stack
  1. scripts/compliance-audit.sh:3641 — main invokes check_action_pinning.
  2. scripts/compliance-audit.sh:516 — check_action_pinning reads remote workflow filenames.
  3. scripts/compliance-audit.sh:546 — add_finding receives the filename-derived identifier.
  4. scripts/compliance-audit.sh:3704 — main passes the recorded finding to create_issue_for_finding.
  5. scripts/compliance-audit.sh:2994 — the audit creates the titled, machine-owned issue.
  6. scripts/compliance-audit.sh:3708 — main invokes close_resolved_issues.
  7. scripts/compliance-audit.sh:3239 — the closer evaluates the identifier as a regex.
  8. scripts/compliance-audit.sh:3240 — the closer closes the still-live finding.

Related: #1036 (earlier fail-open closure defects in close_resolved_issues, closed).


Filed from a CodeRabbit security scan (scan 2d23b5ee-606a-403f-b407-81ddebdb0115, revision 1ea9ee1fbecc). Finding IDs: 463718e2-0d12-4dbd-8c94-8df75d036123. CodeRabbit notes that findings relying on its stated assumptions are capped at medium severity; dismiss if an assumption does not hold.

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

    in-progressAn agent is actively working this issuesecuritySecurity-related PRs and issues

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions