Back to skill

Security audit

GitHub Actions Secret Exposure Audit

Security checks for vulnerabilities and agentic risk

Overview

The skill is a coherent GitHub Actions audit tool, but its JSON report can reproduce suspected hardcoded credential values into logs or artifacts.

Review before installing if you plan to use JSON output in CI or shared logs. The tool is useful for finding risky workflow secret patterns, but treat its JSON reports as sensitive because they may include full lines containing suspected hardcoded credentials. Prefer text output or add redaction before publishing reports.

Vulnerability Patterns
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Agent Memory PoisoningWrites attacker-controlled rules into memory that affect later sessions
  • Remote Payload Retrieval and ExecutionFetches external code whose behavior can change after review
  • Embedded Malicious CodeShips malicious scripts inside the skill and executes them locally
Findings (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/secret-exposure-audit.sh:202
Finding

Hardcoded Credentials Are Exposed in JSON Audit Reports

Content
View full analysis

Vulnerability Details

File Location: scripts/secret-exposure-audit.sh, lines 202–205 and 268
Vulnerability Type: Plaintext sensitive-data exposure through audit output
Risk Level: Medium

Vulnerable Code

python
hardcoded_match = hardcoded_credential_re.match(line)
if hardcoded_match and '${{' not in line and '$' not in line:
    hardcoded_credential_lines.append({'line': idx, 'text': stripped})

The resulting record is later serialized without redaction:

python
if output_format == 'json':
    print(json.dumps({'summary': summary, 'workflows': rows[:top_n], 'all_workflows': rows, 'critical_workflows': critical_rows}, indent=2, sort_keys=True))

Technical Analysis

When the scanner identifies a likely hardcoded credential, it stores the entire source line in the text field. That line includes the suspected credential value rather than only its location and key name.

In JSON mode, the complete finding objects are serialized to standard output. Consequently, a tool intended to detect secret exposure can reproduce plaintext credentials in CI logs, terminal captures, uploaded artifacts, or downstream reporting systems.

The bundled test fixture demonstrates the behavior at fixtures/risky-pr-target.yml:21:

yaml
DEPLOY_PASSWORD: supersecretpassword123

The fixture value is demonstrative rather than evidence of a production credential, but a real scanned workflow with the same pattern would have its value copied into the JSON report.

Attack Path

  1. A repository workflow contains a hardcoded credential matching the scanner's credential pattern.
  2. CI or a developer runs the scanner with OUTPUT_FORMAT=json.
  3. The scanner matches the credential-bearing line and stores the complete line in hardcoded_credential_lines.
  4. JSON serialization writes the unredacted line to standard output.
  5. CI captures that output in logs or stores it as an audit artifact.
  6. A user or integrated system with access to audit outpu ...[truncated 698 chars]
Remediation
View remediation

Remediation Suggestions

  • Do not retain the complete source line for hardcoded-credential findings.
  • Store only non-sensitive metadata, such as the file path, line number, detected key name, and finding type.
  • Redact the value before constructing the finding object, for example:
python
credential_key = hardcoded_match.group(1)
hardcoded_credential_lines.append({
    'line': idx,
    'key': credential_key,
    'text': f'{credential_key}: [REDACTED]',
})
  • Prefer parsing the key separately from the value so that no credential value enters the report data model.
  • Apply redaction at collection time rather than only during JSON rendering. This ensures that future output formats cannot accidentally expose retained plaintext.
  • Add regression tests verifying that known fixture values never appear in text or JSON output.
  • Configure CI systems to treat audit reports as sensitive until existing logs and artifacts have been checked for prior exposure.
  • If real credentials have already appeared in generated reports, remove affected logs or artifacts where possible and rotate those credentials.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (4)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

The workflow directly echoes secrets.GITHUB_TOKEN, which can leak the token into logs, and also passes DEPLOY_API_TOKEN to a third-party action pinned only to a floating major version, creating a supply-chain path for secret exfiltration if that action is changed. The surrounding pull_request_target context makes this especially dangerous because secrets are available in a workflow triggered by untrusted PR activity.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
70% confidence
Finding

Without declared permissions the skill's intent is opaque and cannot be validated.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

Using pull_request_target causes the workflow to run in the security context of the target repository, which can expose repository secrets and elevated GITHUB_TOKEN permissions to code influenced by an untrusted pull request. In this file, that risk is amplified by subsequent steps that print a secret and pass secrets to an action on a floating ref, making the broad trigger materially dangerous rather than merely stylistically broad.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

This code file invokes python3 to process repository workflow files, which is a subprocess execution covered by the missing-warning rule for code files. While the script name suggests auditing, the file itself provides no confirmation prompt, comment, or user-facing disclosure at the execution point about launching the subprocess.

Content

No source excerpt is available for this finding.