Back to skill

Security audit

gitcode-issue-workflow

Security checks for vulnerabilities and agentic risk

Overview

This GitCode workflow is mostly purpose-aligned, but it handles access tokens in unsafe ways and includes an overbroad cleanup command.

Install only if you are comfortable supervising the workflow closely. Prefer the gitcode CLI login flow, do not store GitCode tokens in MEMORY.md or repo files, avoid API examples that put tokens in URLs, use least-privilege short-lived tokens, and review any cleanup command before it removes temp/.

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
SKILL.md:19
Finding

GitCode Access Token Retrieved from Persistent Memory and Exposed in Command-Line URLs

Content
View full analysis
| gitcode auth login --with-token ``` ``` `SKILL.md:69-73`: ```markdown 2. If not authenticated, **prompt the user to run `gitcode auth login`** and stop the workflow 3. If the user prefers not to use the CLI for authentication, fall back to the GitCode API with an explicit token: ```bash curl -s "https://api.gitcode.com/api/v5/repos///issues/?access_token=" curl -s "https://api.gitcode.com/api/v5/repos///issues//comments?access_token=" ``` ``` `SKILL.md:351-353`: ```markdown ```bash curl -s -X POST "https://api.gitcode.com/api/v5/repos///pulls?access_token=" \ -H "Content-Type: application/json" \ ``` `references/gitcode-api.md:9-17`: ```markdown ## Authentication All requests require `access_token` as a query parameter: ``` ?access_token= ``` Token stored in MEMORY.md or provided by user at runtime. ``` `references/gitcode-api.md:50-52`: ```markdown ### Create Pull Request ``` POST /repos/{owner}/{repo}/pulls?access_token= ``` ``` `references/gitcode-api.md:81-83`: ```markdown ```bash curl -s -X POST "https://api.gitcode.com/api/v5/repos/Ascend/msinsight/pulls?access_token=" \ -H "Content-Type: application/json" \ -d @payload.json ``` ### Technical Analysis The Skill directs the Agent to obtain a GitCode ...[truncated 3236 chars]
Remediation
View remediation
` with an authorization header where the API supports it: ```bash curl --fail-with-body --silent --show-error \ -H "Authorization: Bearer ${GITCODE_TOKEN}" \ "https://api.gitcode.com/api/v5/repos///issues/" ``` - Apply the same change to issue comments and pull-request creation requests. - If a particular endpoint only supports query authentication, prefer the authenticated CLI. Clearly warn the user about URL logging and avoid displaying or retaining the generated command. 3. **Protect runtime secret handling** - Supply secrets through a protected environment or secret-injection mechanism rather than interpolating literal values into instructions. - Never print tokens in Agent responses, command previews, errors, design documents, payload files, or logs. - Avoid `echo ` examples containing literal credentials. Use an interactive prompt or secure standard-input mechanism that does not retain the value in history. - Ensure diagnostic output and execution telemetry redact `access_token`, `Authorization`, and equivalent fields. 4. **Enforce least privilege** - Document the minimum GitCode token scopes needed for issue reads, personal-fork pushes, and PR creation. - Use separate narrowly scoped credentials if read and write operations cannot be safely covered by one minimal token. - Do not require organization or upstream-repository write permission for a fork-based contribution workflow. 5. **Limit credential lifetime** ...[truncated 283 chars]
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Tool MisuseTool Parameter Abuse, Chaining Abuse, Unsafe Defaults
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (15)

Tool Parameter Abuse

High
Category
Tool Misuse
Confidence
98% confidence
Finding

The skill includes a forceful recursive deletion command (rm -rf temp/) without safety checks, making it a clear destructive tool-parameter hazard. In agent-controlled environments, relative-path recursive deletion can remove more data than intended if the working directory is different than assumed, or if temp/ contains unrelated materials.

Content

Scanner excerpt · SKILL.md (reported line 437)May include surrounding context.

bash
Remove-Item -Recurse -Force temp/  # Windows
rm -rf temp/                        # Linux/macOS

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill explicitly instructs obtaining a GitCode token from MEMORY.md or the user, which expands the skill from issue-handling into secret discovery and handling. In an agent setting, encouraging retrieval of credentials from local memory/files increases the risk of inadvertent secret exposure, reuse outside least-privilege boundaries, or propagation into logs and downstream commands.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

Adding raw curl-based API access materially broadens the skill's capability beyond the declared CLI workflow and bypasses CLI safety rails such as credential storage, auth UX, and standardized output handling. The fallback also encourages direct token handling in command lines, increasing the chance of leakage through shell history, process listings, transcripts, or copied temp artifacts.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill instructs use of access tokens directly in URLs and references payload/temp-file usage, which creates multiple natural-language avenues for secret disclosure and persistence. Tokens placed in command lines or query strings may be exposed via shell history, terminal logs, browser/proxy logs, process monitors, CI transcripts, and copied files.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
87% confidence
Finding

This instruction transmits repository and authentication data to an external endpoint using curl. External transmission is expected for GitCode operations, but here it is made riskier by embedding the token in the request URL, which can leak sensitive data beyond the intended recipient through local and intermediary logging.

Content

Scanner excerpt · SKILL.md (reported line 72)May include surrounding context.

  1. If not authenticated, prompt the user to run gitcode auth login and stop the workflow
  2. If the user prefers not to use the CLI for authentication, fall back to the GitCode API with an explicit token:
    bash
    curl -s "https://api.gitcode.com/api/v5/repos/<owner>/<repo>/issues/<number>?access_token=<token>"
    curl -s "https://api.gitcode.com/api/v5/repos/<owner>/<repo>/issues/<number>/comments?access_token=<token>"
    

External Transmission

Medium
Category
Data Exfiltration
Confidence
87% confidence
Finding

This instruction transmits repository and authentication data to an external endpoint using curl. External transmission is expected for GitCode operations, but here it is made riskier by embedding the token in the request URL, which can leak sensitive data beyond the intended recipient through local and intermediary logging.

Content

Scanner excerpt · SKILL.md (reported line 72)May include surrounding context.

  1. If not authenticated, prompt the user to run gitcode auth login and stop the workflow
  2. If the user prefers not to use the CLI for authentication, fall back to the GitCode API with an explicit token:
    bash
    curl -s "https://api.gitcode.com/api/v5/repos/<owner>/<repo>/issues/<number>?access_token=<token>"
    curl -s "https://api.gitcode.com/api/v5/repos/<owner>/<repo>/issues/<number>/comments?access_token=<token>"
    

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The PR-creation API fallback extends the skill from a CLI-scoped workflow into direct authenticated HTTP write operations against the remote service. This increases attack surface and creates additional pathways for credential exposure, especially because it pairs external write actions with tokenized curl usage and payload files.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
88% confidence
Finding

This step performs an authenticated external write operation to create a PR via the GitCode API. The operation is functionally aligned with the skill, but it becomes a vulnerability because it relies on direct tokenized HTTP requests and temp-file payloads, increasing exposure of secrets and widening the write-capable surface beyond the CLI path.

Content

Scanner excerpt · SKILL.md (reported line 351)May include surrounding context.

See references/gitcode-api.md for the API endpoint and parameters.

bash
curl -s -X POST "https://api.gitcode.com/api/v5/repos/<owner>/<repo>/pulls?access_token=<token>" \
  -H "Content-Type: application/json" \
  -d @<payload_file>

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The instruction to recursively delete the entire temp/ directory can cause unintended data loss, especially in shared workspaces or if temp/ contains unrelated user artifacts. In an agent workflow, destructive cleanup commands are risky when they are not preceded by enumeration, confirmation, or strict path validation.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · SKILL.md (reported line 73)May include surrounding context.

Base URL

text
https://api.gitcode.com/api/v5

Authentication

External Transmission

Medium
Category
Data Exfiltration
Confidence
50% confidence
Finding

Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

Content

Scanner excerpt · references/gitcode-api.md (reported line 6)May include surrounding context.

Base URL

text
https://api.gitcode.com/api/v5

Authentication

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

The authentication guidance tells users to pass access tokens as query parameters and mentions storing them without any warning about leakage risks. Query-string tokens are prone to exposure through shell history, process listings, logs, browser history, proxies, and copied command transcripts, making credential compromise more likely in an automated workflow.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The documentation explicitly instructs storing a GitCode access token in MEMORY.md, which normalizes persisting credentials in project-accessible context rather than using a secure secret store. In an agent skill, this is especially dangerous because memory files may be logged, committed, surfaced to other tools, or reused across tasks, leading to credential disclosure and unauthorized repository access.

Content

No source excerpt is available for this finding.

External Transmission

Medium
Category
Data Exfiltration
Confidence
93% confidence
Finding

This finding duplicates the same cross-repo PR curl example and reflects the same underlying issue: embedding an access token in a URL for an external request. In an agent-oriented skill, such examples are more dangerous because users or tools may copy them verbatim into logs, automation, or transcripts, causing inadvertent secret exposure.

Content

Scanner excerpt · references/gitcode-api.md (reported line 81)May include surrounding context.

Cross-repo PR example (fork → upstream):

bash
curl -s -X POST "https://api.gitcode.com/api/v5/repos/Ascend/msinsight/pulls?access_token=<token>" \
  -H "Content-Type: application/json" \
  -d @payload.json

External Transmission

Medium
Category
Data Exfiltration
Confidence
93% confidence
Finding

This finding duplicates the same cross-repo PR curl example and reflects the same underlying issue: embedding an access token in a URL for an external request. In an agent-oriented skill, such examples are more dangerous because users or tools may copy them verbatim into logs, automation, or transcripts, causing inadvertent secret exposure.

Content

Scanner excerpt · references/gitcode-api.md (reported line 81)May include surrounding context.

Cross-repo PR example (fork → upstream):

bash
curl -s -X POST "https://api.gitcode.com/api/v5/repos/Ascend/msinsight/pulls?access_token=<token>" \
  -H "Content-Type: application/json" \
  -d @payload.json

Static analysis

No suspicious patterns detected.