Back to skill

Security audit

homework-grade

Security checks for vulnerabilities and agentic risk

Overview

The skill does what it claims, but it handles email credentials, untrusted ZIP attachments, student code, and grading records with unsafe scoping and validation.

Review before installing. Use only a dedicated QQ mailbox and app-specific authorization code, process mail only from trusted senders, and run this skill in an isolated workspace with no sensitive files or host credentials. Do not rely on the generated grades without review, because student submissions can influence the AI prompt. The ZIP download and extraction code should be fixed before production use.

Vulnerability Patterns
  • Skill Instruction HijackingAlters the agent's session goals or safety constraints when the skill loads
  • Unauthorized Access and Privilege EscalationObtains permissions beyond the task's legitimate needs
  • 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
Findings (6)

T09 · Insecure Skill Coding Practices

Error
Location
modules/email_fetcher.py:18
Finding

Arbitrary File Write Through an Untrusted Email Attachment Filename

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
modules/extractor.py:4
Finding

Unsafe Extraction of Untrusted ZIP Archives

Content
View full analysis
Remediation
View remediation

T01 · Skill Instruction Hijacking

Error
Location
modules/ai_grader.py:16
Finding

Student-Controlled Prompt Injection Can Manipulate AI Grades

Content
View full analysis
Remediation
View remediation

T05 · Unauthorized Access and Privilege Escalation

Error
Location
modules/grader.py:4
Finding

Grading Module Can Execute Untrusted Student Python Without Isolation

Content
View full analysis
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
modules/excel_writer.py:4
Finding

Untrusted Grading Data Can Be Exported as Spreadsheet Formulas

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Note
Location
requirements.txt:1
Finding

Unpinned Dependencies and an Undeclared Runtime Package

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Behavioral ASTexec() Call, eval() Call, Dynamic Import
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
Findings (24)

Missing User Warnings

High
Category
Not specified by scanner
Confidence
99% confidence
Finding

This grader runs student-provided Python files without any warning, sandboxing, or security controls beyond a timeout. In the context of a grading skill, the input is explicitly adversarial or at least untrusted, so executing submissions directly can lead to arbitrary code execution on the grading machine and compromise of other students' data or platform infrastructure.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The skill declares email_user and email_auth_code as inputs but provides no warning about sensitivity, no guidance on secure handling, and no indication that a mailbox authorization code will be used to authenticate to QQ Mail. Collecting email credentials without disclosure materially increases the risk of credential misuse, accidental exposure in logs, or overbroad mailbox access.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The function retrieves email attachments using email_user and email_auth_code, which indicates access to sensitive credentials and mailbox contents. In this file there is no confirmation prompt, user-facing notice, or explanatory comment/docstring disclosing that the skill will access the user's email account.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The function recursively reads all Python files from both the student and template directories and includes their full contents in a prompt sent to an external LLM API. That creates a real source-code exfiltration path: student submissions, reference solutions, embedded secrets, or proprietary grading material may be disclosed to a third party without minimization, consent, or access controls.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The natural-language prompt requires the model to grade and respond in Chinese, including fixed Chinese field labels. This enforces a specific language/locale without any user opt-in or documented justification, which is a natural-language policy concern.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The code sends the student and template code to an external API but provides no user-facing warning, consent mechanism, or in-file indication that local source code leaves the system. In an educational context this is sensitive because submissions and answer keys may be confidential, and undisclosed transfer increases privacy, compliance, and trust risks.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The function logs into a real mailbox using supplied credentials/auth code and enumerates unread messages without any visible disclosure, access scoping, or consent checks. In an agent skill context, silent access to a user's inbox is sensitive because it enables collection of private email content and attachments beyond what a user may reasonably expect.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The code automatically writes unseen email ZIP attachments to local storage with no validation, user notification, or consent flow. This creates a risky ingestion path for untrusted content and can expose the host to malware staging, disk abuse, or downstream processing of attacker-controlled files.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This extraction code writes files from an untrusted ZIP archive directly to disk using extractall() without validating member paths. A crafted archive can perform path traversal (Zip Slip) and overwrite files outside the intended extraction directory, potentially leading to arbitrary file overwrite and code or configuration tampering; the lack of user-facing disclosure is secondary to this more serious unsafe extraction behavior.

Content

No source excerpt is available for this finding.

subprocess module call

Medium
Category
Dangerous Code Execution
Confidence
96% confidence
Finding

The code executes a Python file in a subprocess based on a path discovered from the student directory, which means untrusted student code is intentionally run by the grader. Even without shell=True, this is dangerous because the executed code can read files, exfiltrate secrets, consume resources, or attack the host environment; the 5-second timeout only limits runtime and does not provide isolation.

Content

Scanner excerpt · modules/grader.py (reported line 6)May include surrounding context.

python
def run_code(file_path):
    try:
        result = subprocess.run(
            ["python", file_path],
            capture_output=True,
            text=True,

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
92% confidence
Finding

The workflow states that ZIP attachments are downloaded, extracted, and used to generate local Excel output, but it does not warn about the filesystem risks of extracting archives or writing files locally. ZIP extraction can expose the host to malicious archive contents such as path traversal or oversized payloads, while output generation may overwrite or create sensitive files unexpectedly.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The skill requests QQ email credentials and processes attachments from a mailbox, but it does not warn users about the sensitivity of the authorization code or the risks of automatically downloading content from email. This can lead users to provide credentials without understanding exposure risks, and to ingest potentially malicious attachments from untrusted or spoofed senders.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest states that the skill will automatically download homework from a QQ mailbox and generate an Excel file, but it does not disclose mailbox access scope, what data will be read, where attachments or outputs will be stored, or what user consent is expected. This creates a real security and privacy risk because users may provide access credentials without understanding that the skill will access potentially sensitive email content and write files to disk.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The skill extracts archives from email attachments without any visible validation or sandboxing before processing. If the unzip helper does not defend against path traversal, zip bombs, or unsafe file types, a crafted attachment could overwrite files or exhaust disk resources on the local system.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The call to save_to_excel(results, assignment_id) persists student names, IDs, scores, and comments to a file. There is no visible warning, prompt, or comment in this file informing the user that graded student data will be stored locally.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

Reading an API credential from the environment is access to sensitive configuration. In this file there is no comment, docstring, or user-visible message explaining that a credential is required and will be used for external API access.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The regular expression requires filenames containing the Chinese phrase "第...次作业", which imposes a specific language/locale convention. The file provides no natural-language justification or opt-in indicating that this parser is intentionally limited to a Chinese-language regional workflow.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

This code writes user-provided data to an .xlsx file on disk, which is a file-write operation covered by the missing-warning rule for code files. There is no confirmation prompt, logging/print statement, or explanatory docstring/comment disclosing that the function creates output under data/results.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
98% confidence
Finding

The dependency 'pandas' is unpinned, so installations may resolve to different versions over time, reducing build reproducibility and potentially pulling in a vulnerable or breaking release unexpectedly. In a security context, lack of version pinning weakens supply-chain control even though the file itself does not prove exploitation.

Content

Scanner excerpt · requirements.txt (reported line 1)May include surrounding context.

text
pandas
openpyxl

Unverifiable Dependency: pandas has 1 known advisory(ies) (CVE-2020-13091 (** DISPUTED ** pandas through 1.0.3 can unserialize and execute commands from an)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
87% confidence
Finding

The manifest references 'pandas' without a version pin, and known advisories exist for some releases, so it is impossible to verify from this file whether deployment will select an affected version. The risk is contextual and indirect here: the issue is uncertainty and potential exposure, not confirmation that a vulnerable version is in use.

Content

No source excerpt is available for this finding.

Unpinned Dependencies

Low
Category
Supply Chain
Confidence
98% confidence
Finding

The dependency 'openpyxl' is unpinned, which allows future installs to fetch any currently available version and makes the environment non-reproducible. This increases supply-chain risk because a vulnerable or incompatible version could be installed without explicit review.

Content

Scanner excerpt · requirements.txt (reported line 2)May include surrounding context.

text
pandas
openpyxl

Unverifiable Dependency: openpyxl has 2 known advisory(ies) (CVE-2017-5992 (Improper Restriction of XML External Entity Reference in Openpyxl); CVE-2017-5992 (Openpyxl 2.4.1 resolves external entities by default, which allows remote attack)), but the manifest does not pin a version, so it is unknown whether the installed release is affected

Low
Category
Supply Chain
Confidence
90% confidence
Finding

The manifest references 'openpyxl' without pinning a version, while known advisories affect some historical releases, so the actual security posture cannot be verified from this file alone. Because openpyxl commonly processes spreadsheet/XML content, using an affected version could matter if the skill handles untrusted files.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The natural-language instructions and labels are written in Chinese, which effectively forces a specific language for users without any opt-in or alternative language option. The policy allows locale constraints when they are documented and justified, but this file does not state that the skill is intentionally limited to Chinese-speaking users or a China-specific environment.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
80% confidence
Finding

The only natural-language description is written in Chinese and presents the skill behavior without indicating language options or that the skill is specifically limited to a Chinese-language context. Under the policy, forcing a specific language or locale without opt-in can be a natural-language policy concern.

Content

No source excerpt is available for this finding.