Back to skill

Security audit

gitea-routine-report

Security checks for vulnerabilities and agentic risk

Overview

The skill matches its stated reporting purpose, but it handles Gitea tokens, private repository activity, and outbound email with concrete safety gaps users should review before installing.

Install only with a narrowly scoped read-only Gitea token, verify the configured Gitea URL, restrict permissions on ~/.config/gitea-routine-report/.env, and review recipients before sending reports. Treat repository content and AI-generated summaries as untrusted until HTML escaping, safer temporary files, and stronger confirmation boundaries are added.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • Insecure Skill Coding PracticesFinds exploitable flaws such as hardcoded secrets or command injection
  • 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
Findings (5)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/render_email.py:104
Finding

Unescaped Repository and AI Content Injected into HTML Email

Content
View full analysis
{icon} #{i+1} {name} {stat['commits']} 次 ``` ```python for c in stat.get("commit_details", []): time_str = _fmt_time(c.get("time", "")) msg = c.get("message", "") files_html = "" for f in c.get("files", []): fname = f.get("filename", "") fdel = f.get("deletions", 0) files_html += f"""
📁 {fname}   -{fdel}
""" commit_items += f"""
🕐 {time_str}
{msg}
{files_html}
""" ``` ```python if risk_notes.strip(): risk_lines = "".join( f'
{line}
\n' for line in risk_notes.strip().splitlines() if line.strip() ) ``` ```python

现状:{ai_overview}

下一步建议:{ai_suggestion}

``` ### Technical Analysis Repository names, usernames, branch names, commit messages, filenames, inactive-member fields, and AI-generated text are inserted directly into HTML using formatted strings. No HTML escaping or sanitization occurs before interpolation. Several of these values are controllable by repository contributors. A contributor can create a commit message, branch, or filename containing HTML such as an external image, dec ...[truncated 1511 chars]

T09 · Insecure Skill Coding Practices

Error
Location
SKILL.md:145
Finding

Predictable Shared Temporary Files Permit Symlink Attacks and Cross-Run Data Confusion

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
setup.sh:31
Finding

Gitea Token File Is Created Without Enforced Restrictive Permissions

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
requirements.txt:1
Finding

Unbounded Dependency Versions Create a Non-Reproducible Supply-Chain Risk

Content
View full analysis
=2.31.0 python-dotenv>=1.0.0 ``` ```bash echo "[2/4] Upgrading pip..." python -m pip install --upgrade pip echo "[3/4] Installing dependencies..." pip install -r "$REQ_FILE" ``` ### Technical Analysis The requirements specify only minimum versions and no upper bounds or hashes. Setup also upgrades `pip` to the newest available release. Therefore, the code reviewed during the audit is not sufficient to determine which dependency code will execute during a future installation. No evidence was found that `requests` or `python-dotenv` are malicious packages; both names correspond to established packages. The weakness is the installation policy: any future version satisfying the lower bound may be selected, and package artifacts are not authenticated against a reviewed hash lock. ### Attack Path 1. A user runs `setup.sh` at a later date. 2. `pip` resolves the newest versions satisfying the broad constraints. 3. A compromised, malicious, or unexpectedly incompatible future release is selected from the configured package index. 4. Package installation hooks or imported runtime code execute with the setup user's privileges. 5. Because the Skill later handles `GITEA_TOKEN` and private repository data, a compromised dependency could access those values. ### Impact Assessment The potential impact is code execution with the privileges of the user running setup or the Skill. This could expose the Gitea token, repository report data, and files accessible to that user. Exploitation depends on compromise of the package source, package account, index configuration, or a harmful future release; no currently malicious dependency was identified in the audited files. ]]>
Remediation
View remediation
=`. - Generate a lock file containing hashes, such as a `pip-compile --generate-hashes` output. - Install with hash enforcement: ```bash python -m pip install --require-hashes -r requirements.txt ``` - Pin the installer tooling or avoid automatically upgrading `pip` during every setup. - Use only a trusted package index and explicitly configure it if the execution environment may contain custom index settings. - Add automated dependency vulnerability monitoring and review upgrades before updating the lock file. - Build and test installations in an isolated environment before deployment. ]]>

T01 · Skill Instruction Hijacking

Warning
Location
main.js:63
Finding

Attacker-Controlled Repository Text Is Passed to the Agent Without a Prompt-Injection Boundary

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • 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 (47)

Tainted flow: 'collab_url' from os.getenv (line 101, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/generate_report.py (reported line 102)May include surrounding context.

python
# 方式一:获取仓库协作者
    collab_url = f"{GITEA_URL}/api/v1/repos/{repo_full_name}/collaborators"
    resp = requests.get(collab_url, headers=headers)
    if resp.status_code == 200:
        for u in resp.json():
            members.add(u.get("login", ""))

Tainted flow: 'repo_url' from os.getenv (line 108, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/generate_report.py (reported line 109)May include surrounding context.

python
# 方式二:加上 owner 本人
    repo_url = f"{GITEA_URL}/api/v1/repos/{repo_full_name}"
    resp2 = requests.get(repo_url, headers=headers)
    if resp2.status_code == 200:
        owner = resp2.json().get("owner", {}).get("login", "")
        if owner:

Tainted flow: 'url' from os.getenv (line 122, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/generate_report.py (reported line 124)May include surrounding context.

python
headers = {"Authorization": f"token {GITEA_TOKEN}"}
    url = f"{GITEA_URL}/api/v1/repos/{repo_full_name}/commits"
    params = {"limit": 1, "page": 1}
    resp = requests.get(url, headers=headers, params=params)
    if resp.status_code != 200:
        return None

Tainted flow: 'url' from os.getenv (line 122, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/generate_report.py (reported line 130)May include surrounding context.

python
# 遍历所有提交找该成员最新的
    params_all = {"limit": 50, "page": 1}
    resp_all = requests.get(url, headers=headers, params=params_all)
    if resp_all.status_code != 200:
        return None

Tainted flow: 'url' from os.getenv (line 21, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/get_admin_emails.py (reported line 22)May include surrounding context.

python
"""获取仓库创建人(owner)的注册邮箱"""
    owner = repo_full_name.split("/")[0]
    url = f"{GITEA_URL}/api/v1/users/{owner}"
    response = requests.get(url, headers=HEADERS)
    if response.status_code == 200:
        return response.json().get("email", "")
    return ""

Tainted flow: 'url' from os.getenv (line 43, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/get_commits.py (reported line 45)May include surrounding context.

python
while True:
        url = f"{GITEA_URL}/api/v1/repos/search"
        params = {"limit": 50, "page": page}
        response = requests.get(url, headers=HEADERS, params=params)
        if response.status_code != 200:
            break
        data = response.json().get("data", [])

Tainted flow: 'url' from os.getenv (line 43, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/get_commits.py (reported line 143)May include surrounding context.

python
while True:
        url = f"{GITEA_URL}/api/v1/repos/search"
        params = {"limit": 50, "page": page}
        response = requests.get(url, headers=HEADERS, params=params)
        if response.status_code != 200:
            break
        data = response.json().get("data", [])

Tainted flow: 'url' from os.getenv (line 43, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/get_commits.py (reported line 91)May include surrounding context.

python
# 获取所有分支
    url = f"{GITEA_URL}/api/v1/repos/{repo_full_name}/branches"
    response = requests.get(url, headers=HEADERS, params={"limit": 50})
    if response.status_code != 200:
        return sha_to_branch

Tainted flow: 'commits_url' from os.getenv (line 100, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/get_commits.py (reported line 107)May include surrounding context.

python
}
        if since:
            params["since"] = since.strftime("%Y-%m-%dT%H:%M:%SZ")
        branch_resp = requests.get(commits_url, headers=HEADERS, params=params)
        if branch_resp.status_code == 200:
            for commit in branch_resp.json():
                sha = commit["sha"]

Tainted flow: 'diff_url' from os.getenv (line 159, credential/environment) → requests.get (network output)

Critical
Category
Data Flow
Confidence
90% confidence
Finding

Credentials or environment variables flow to a network sink. This is a high-confidence indicator of credential exfiltration.

Content

Scanner excerpt · scripts/get_commits.py (reported line 160)May include surrounding context.

python
# 获取文件变动详情
        diff_url = f"{GITEA_URL}/api/v1/repos/{repo_full_name}/git/commits/{sha}"
        diff_resp = requests.get(diff_url, headers=HEADERS)
        files = []
        total_additions = 0
        total_deletions = 0

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

A skill that claims end-to-end reporting but may only render HTML for provided input can still be risky because consumers may assume repository fetching and recipient validation were already handled securely. Ambiguous ownership of security checks can lead to unsafe use of untrusted report data or accidental emailing to unintended recipients.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

A skill that claims end-to-end reporting but may only render HTML for provided input can still be risky because consumers may assume repository fetching and recipient validation were already handled securely. Ambiguous ownership of security checks can lead to unsafe use of untrusted report data or accidental emailing to unintended recipients.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

A skill that claims end-to-end reporting but may only render HTML for provided input can still be risky because consumers may assume repository fetching and recipient validation were already handled securely. Ambiguous ownership of security checks can lead to unsafe use of untrusted report data or accidental emailing to unintended recipients.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
95% confidence
Finding

A skill that claims end-to-end reporting but may only render HTML for provided input can still be risky because consumers may assume repository fetching and recipient validation were already handled securely. Ambiguous ownership of security checks can lead to unsafe use of untrusted report data or accidental emailing to unintended recipients.

Content

No source excerpt is available for this finding.

Credential Access

High
Category
Privilege Escalation
Confidence
70% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · env-example.txt (reported line 4)May include surrounding context.

text
# Gitea server base URL (no trailing slash)
GITEA_URL=https://your-gitea.example.com

# Personal access token with read repository permissions
GITEA_TOKEN=your_gitea_token_here

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/generate_report.py (reported line 19)May include surrounding context.

python
REQ_FILE="$ROOT_DIR/requirements.txt"
ENV_EXAMPLE_FILE="$ROOT_DIR/env-example.txt"
CONFIG_DIR="$HOME/.config/gitea-routine-report"
ENV_FILE="$CONFIG_DIR/.env"

if ! command -v python3 >/dev/null 2>&1; then
  echo "Error: python3 not found. Please install Python 3 first."

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/get_admin_emails.py (reported line 12)May include surrounding context.

python
REQ_FILE="$ROOT_DIR/requirements.txt"
ENV_EXAMPLE_FILE="$ROOT_DIR/env-example.txt"
CONFIG_DIR="$HOME/.config/gitea-routine-report"
ENV_FILE="$CONFIG_DIR/.env"

if ! command -v python3 >/dev/null 2>&1; then
  echo "Error: python3 not found. Please install Python 3 first."

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/get_commits.py (reported line 16)May include surrounding context.

python
REQ_FILE="$ROOT_DIR/requirements.txt"
ENV_EXAMPLE_FILE="$ROOT_DIR/env-example.txt"
CONFIG_DIR="$HOME/.config/gitea-routine-report"
ENV_FILE="$CONFIG_DIR/.env"

if ! command -v python3 >/dev/null 2>&1; then
  echo "Error: python3 not found. Please install Python 3 first."

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · scripts/render_email.py (reported line 13)May include surrounding context.

python
REQ_FILE="$ROOT_DIR/requirements.txt"
ENV_EXAMPLE_FILE="$ROOT_DIR/env-example.txt"
CONFIG_DIR="$HOME/.config/gitea-routine-report"
ENV_FILE="$CONFIG_DIR/.env"

if ! command -v python3 >/dev/null 2>&1; then
  echo "Error: python3 not found. Please install Python 3 first."

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · setup.sh (reported line 12)May include surrounding context.

sh
REQ_FILE="$ROOT_DIR/requirements.txt"
ENV_EXAMPLE_FILE="$ROOT_DIR/env-example.txt"
CONFIG_DIR="$HOME/.config/gitea-routine-report"
ENV_FILE="$CONFIG_DIR/.env"

if ! command -v python3 >/dev/null 2>&1; then
  echo "Error: python3 not found. Please install Python 3 first."

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · setup.sh (reported line 47)May include surrounding context.

sh
- name: GITEA_TOKEN
    type: personal_access_token
    provider: gitea
environment_file: ~/.config/gitea-routine-report/.env

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · setup.sh (reported line 50)May include surrounding context.

sh
- name: GITEA_TOKEN
    type: personal_access_token
    provider: gitea
environment_file: ~/.config/gitea-routine-report/.env

Credential Access

High
Category
Privilege Escalation
Confidence
60% confidence
Finding

Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.

Content

Scanner excerpt · skill.yaml (reported line 16)May include surrounding context.

yaml
- name: GITEA_TOKEN
    type: personal_access_token
    provider: gitea
environment_file: ~/.config/gitea-routine-report/.env

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
89% confidence
Finding

The skill directs execution of local Python scripts, accesses temporary files, imports local modules, and depends on email delivery, yet it declares no explicit tool scope or permission boundaries. This increases the chance that an agent can invoke code execution, environment access, or networked email behavior without clear user-visible constraints or policy enforcement.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
91% confidence
Finding

The skill does not clearly warn users that repository activity summaries, contributor rankings, inactivity lists, and risk notes may be emailed to repository administrators. This can lead to unintended disclosure of sensitive operational or personnel information, especially when the user did not realize an outbound communication side effect would occur.

Content

No source excerpt is available for this finding.