Back to skill

Security audit

GitCode PR Audit

Security checks for vulnerabilities and agentic risk

Overview

This skill appears to be a legitimate GitCode PR audit helper, with normal token/API use and minor cautions about local output files and token scope.

Use a least-privilege GitCode token, preferably read-only and limited to the repositories you intend to audit. Be aware that the skill reads private PR metadata available to that token and prints or optionally writes the results locally; choose --output paths carefully because existing files can be overwritten. Date ranges are interpreted using Asia/Shanghai time.

Vulnerability Patterns
  • 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
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • Taint TrackingDirect Taint Flow, Variable-Mediated Taint Flow, Credential Exfiltration Chain
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (7)

Tainted flow: 'req' from os.environ.get (line 114, credential/environment) → urllib.request.urlopen (network output)

Critical
Category
Data Flow
Content
last_err = None
    for attempt in range(RETRY_TIMES + 1):
        try:
            with urlopen(req, timeout=timeout_sec) as resp:
                time.sleep(REQUEST_SLEEP_SEC)
                raw = resp.read().decode("utf-8")
                return (json.loads(raw), None)
Confidence
90% confidence
Finding
Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Lp3

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding
The skill advertises capabilities to read environment variables, access the filesystem, write files, invoke shell commands, and make network requests, but it does not declare any explicit tool scope or allowed-tools boundary. In an agent setting, this weakens least-privilege controls and can let the skill be invoked with broader powers than are necessary, increasing the blast radius if the skill is misused or its downstream script behaves unexpectedly.

Natural-Language Policy Violations

Medium
Confidence
95% confidence
Finding
The parameter documentation defines `--since` and `--until` using Shanghai time, which imposes a specific locale/timezone behavior. Under the policy rule, forcing a locale-specific interpretation without user opt-in or a clearly justified regional constraint is a natural-language policy violation.

External Transmission

Medium
Category
Data Exfiltration
Content
from urllib.parse import urlencode
from urllib.request import Request, urlopen

GITCODE_API_BASE = "https://api.gitcode.com/api/v5"
SCRIPT_DIR = Path(__file__).resolve().parent
SKILL_ROOT = SCRIPT_DIR.parent
Confidence
60% confidence
Finding
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.

subprocess module call

Medium
Category
Dangerous Code Execution
Content
if sys.platform != "win32":
        return None
    try:
        out = subprocess.check_output(
            [
                "powershell",
                "-NoProfile",
Confidence
70% confidence
Finding
subprocess module calls execute external commands. Without careful input validation, this enables command injection.

Natural-Language Policy Violations

Medium
Confidence
88% confidence
Finding
The docstring states that date parsing is based on Shanghai time, and the CLI help later presents date boundaries in Shanghai time as the default interpretation. This imposes a specific locale/timezone behavior in user-facing language without offering a choice or opt-in, which matches the language/locale policy violation criteria.

Missing User Warnings

Low
Confidence
89% confidence
Finding
The skill allows `--output` to be set to an arbitrary user-specified path and states that it will write Markdown or CSV there, but it provides no warning or constraint on overwriting local files. In an agent environment, this can lead to unintended modification of sensitive files, clobbering existing data, or path abuse if a user supplies a dangerous destination.

Static analysis

No suspicious patterns detected.