Back to skill

Security audit

SJTU SLURM Skill

Security checks for vulnerabilities and agentic risk

Overview

The skill appears intended for legitimate SJTU HPC account and job management, but it handles a user's reusable password and local credential files in ways that need careful review.

Review before installing. Use this only in a trusted local environment for an SJTU HPC account you control, avoid entering passwords directly in chat, and be aware that it stores tokens and SSH credentials in the workspace and can perform user-level SSH, job, account, and data operations.

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 (2)

T09 · Insecure Skill Coding Practices

Error
Location
scripts/req_token.py:110
Finding

HPC Password Exposed Through Process Command-Line Arguments

Content
View full analysis
[--workspace WORKSPACE] [--textfile TEXTFILE] Arguments: username: HPC account username password: HPC account password ``` ```python parser.add_argument("username", help="HPC account username") parser.add_argument("password", help="HPC account password") ``` The Skill documentation directs the Agent to invoke the script as follows: ```text req_token.py "username" "password" --workspace "path_to_workspace" --textfile "uploaded_file_path" ``` ### Technical Analysis The script accepts the user's HPC password as a positional command-line argument. Command-line arguments are not a secure secret transport mechanism. Depending on the operating system and execution environment, they can be exposed through: - Process inspection utilities and process metadata. - Shell history. - Agent command-execution logs and traces. - Audit or observability systems. - Error reports that reproduce the invoked command. - Other local processes or users with permission to inspect process information. The `--textfile` option does not mitigate this exposure because the implementation does not read the password from that file. The caller must still include the plaintext password in `args.password`. This behavior conflicts with the documentation’s stated objective of avoiding plaintext password leakage. Sending the password to the declared SJTU HPC HTTPS authentication endpoint is necessary for token acquisition, but exposing it in local process arguments is not necessary and exceeds the minimum secret exposure required by the functionality. ### Attack Path 1. A user follows the Skill instructions and provides an HPC password, potentially through an uploaded f ...[truncated 1372 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/req_token.py:32
Finding

Arbitrary Writable File Deletion Through Unvalidated --textfile Path

Content
View full analysis
None: """Delete the specified file if it exists.""" if file_path and os.path.exists(file_path): try: os.remove(file_path) print(f"Deleted password file: {file_path}") except Exception as e: print(f"Warning: Failed to delete password file {file_path}: {e}", file=sys.stderr) ``` ```python parser.add_argument( "--textfile", default=None, help="Path to a file containing the password. If provided, the file will be deleted after the token is successfully saved to prevent password leak." ) ``` ```python # Delete the password file if --textfile was specified if args.textfile: delete_file_if_exists(args.textfile) ``` ### Technical Analysis The `--textfile` argument accepts an arbitrary filesystem path and deletes that path after a successful token request. The implementation does not: - Read the password from the specified file. - Confirm that the file supplied the password used for authentication. - Restrict the path to an approved upload or temporary directory. - Verify ownership. - Verify that the target is a regular file. - Reject symbolic links. - Require an explicit cleanup confirmation. - Bind cleanup to the exact file securely opened for password input. Consequently, `--textfile` functions as a conditional arbitrary-file deletion primitive. Any file writable by the account running the Agent can be selected for deletion. A valid token request is required before the deletion occurs, but this condition does not ensure that the selected path is a password file. The deletion capability is not necessary for requesting an API token and exceeds least privilege. Cleanup could instead be managed by the upload subsystem or ti ...[truncated 1696 chars]
Remediation
View remediation
Vulnerability Patterns
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • 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
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
Findings (22)

Tp4

High
Category
MCP Tool Poisoning
Confidence
96% confidence
Finding

This version of the mismatch points to concrete risky behavior beyond the stated purpose: storing auth tokens locally and deleting a user-specified text file. Those side effects are sensitive and should be explicitly disclosed because hidden credential handling and file deletion can surprise users and increase risk of misuse or data loss.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

This version of the mismatch points to concrete risky behavior beyond the stated purpose: storing auth tokens locally and deleting a user-specified text file. Those side effects are sensitive and should be explicitly disclosed because hidden credential handling and file deletion can surprise users and increase risk of misuse or data loss.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
97% confidence
Finding

This version of the mismatch points to concrete risky behavior beyond the stated purpose: storing auth tokens locally and deleting a user-specified text file. Those side effects are sensitive and should be explicitly disclosed because hidden credential handling and file deletion can surprise users and increase risk of misuse or data loss.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The instructions explicitly tell the agent to collect a user's password via chat or uploaded text file and pass it to scripts. This creates a direct path for handling raw credentials in natural-language tooling, exposing them to transcript retention, file residue, process arguments, and accidental disclosure across the agent stack.

Content

No source excerpt is available for this finding.

External Script Fetching

High
Category
Supply Chain
Confidence
90% confidence
Finding

Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.

Content

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

md
- `GET /user`: query user's information.
  - Response will includ all the attributes defined by posixAccount and some addditional fields like jAccount, email, user type, etc.
  - CURL example: `curl -L 'https://api.hpc.sjtu.edu.cn/user?name=userA&domain=pi' --header 'Authorization: Bearer ***'`
- `PATCH /user`: update user's information.
  - Only password, Email/jAccount, preferred contact method can be updated by user itself.
  - Update request will trigger two-factor authentication via JWB APP (交我办) or Email. Ask user whether it have been prepared to do the authentication before you send the request.

Ssd 3

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The skill instructs the agent to send private SSH keys and certificates back to the user, normalizing transmission of long-lived credential material through potentially insecure channels. Even if the user requested them, transferring private keys through chat-adjacent mechanisms raises the risk of interception, duplication, and future unauthorized access to the HPC environment.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
91% confidence
Finding

The skill requires shell, network, file read, and file write capabilities but does not declare any tool scope restrictions. That creates an over-privileged execution model where a caller or host may permit more operations than are strictly necessary, increasing the blast radius if the skill is misused or compromised.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The activation text is broad enough to trigger on vague HPC-related requests, which can cause the skill to engage credentialed network and shell workflows prematurely. In a skill that can obtain tokens, SSH certificates, and execute remote commands, over-broad invocation materially increases the chance of unnecessary sensitive operations.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
84% confidence
Finding

The skill asks for the user's HPC password during token acquisition and only lightly suggests using an uploaded file, without a strong warning against sending secrets in chat. That normalizes collection of highly sensitive credentials through conversational channels, which are more prone to logging, accidental disclosure, and mishandling.

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 55)May include surrounding context.

md
- `GET /user`: query user's information.
  - Response will includ all the attributes defined by posixAccount and some addditional fields like jAccount, email, user type, etc.
  - CURL example: `curl -L 'https://api.hpc.sjtu.edu.cn/user?name=userA&domain=pi' --header 'Authorization: Bearer ***'`
- `PATCH /user`: update user's information.
  - Only password, Email/jAccount, preferred contact method can be updated by user itself.
  - Update request will trigger two-factor authentication via JWB APP (交我办) or Email. Ask user whether it have been prepared to do the authentication before you send the request.

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 59)May include surrounding context.

md
- `GET /user`: query user's information.
  - Response will includ all the attributes defined by posixAccount and some addditional fields like jAccount, email, user type, etc.
  - CURL example: `curl -L 'https://api.hpc.sjtu.edu.cn/user?name=userA&domain=pi' --header 'Authorization: Bearer ***'`
- `PATCH /user`: update user's information.
  - Only password, Email/jAccount, preferred contact method can be updated by user itself.
  - Update request will trigger two-factor authentication via JWB APP (交我办) or Email. Ask user whether it have been prepared to do the authentication before you send the request.

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 64)May include surrounding context.

md
- `GET /user`: query user's information.
  - Response will includ all the attributes defined by posixAccount and some addditional fields like jAccount, email, user type, etc.
  - CURL example: `curl -L 'https://api.hpc.sjtu.edu.cn/user?name=userA&domain=pi' --header 'Authorization: Bearer ***'`
- `PATCH /user`: update user's information.
  - Only password, Email/jAccount, preferred contact method can be updated by user itself.
  - Update request will trigger two-factor authentication via JWB APP (交我办) or Email. Ask user whether it have been prepared to do the authentication before you send the request.

Whitespace Padding

Medium
Category
Prompt Injection
Confidence
70% confidence
Finding

Large whitespace padding was detected (a block of blank lines or a long run of spaces). This can push injected instructions below or to the right of the visible area so a human reviewer never sees them while the agent still reads them. Manual review of the hidden content is recommended.

Content

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

md
Note that user data is distributed across multiple shared storage pools, and visible storage varies depending on the node group. The storage where the user's home directory resides also differs:

| node group | mount point | storage information                                                                                              |
| ---------- | ----------- | ---------------------------------------------------------------------------------------------------------------- |
| pi, kp     | /lustre     | Hot storage, Lustre, user home directory is here                                                                 |
| sy         | /dssg       | Hot storage, GPFS, user home directory is here                                                                   |

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

This script requests a fresh SSH private key and certificate and stores them locally, which expands capability from API-mediated job/data actions to direct shell access on the HPC cluster. In the context of an agent skill, that broader access path increases the blast radius of compromise, bypasses tighter workflow constraints, and creates sensitive credential material on disk that could be reused if the workspace is exposed.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
88% confidence
Finding

The manifest describes using the skill to perform HPC job queries, submissions, cancellations, and data management. This file instead authenticates directly against the HPC API, obtains a bearer token, and persists that credential locally for later use; credential bootstrapping and storage are not mentioned in the stated purpose and represent a sensitive capability beyond the user-facing HPC operation scope.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script emits user-facing error text in Chinese in raised exceptions, while other messages in the file are in English. This imposes a specific language on users without opt-in or documented locale justification, which matches the language-policy violation criteria.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
96% confidence
Finding

The generic exception handler prints "未知错误" to stderr, which is a user-facing Chinese-only message. The file does not document that this skill is region- or language-specific, nor does it offer the user a language choice.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
97% confidence
Finding

The script emits user-facing error text in Chinese (for example, token-related errors) while the rest of the interface and usage text are in English. This creates a language/locale policy issue because users are not given a choice of language and no region-specific justification is documented in the file.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
98% confidence
Finding

The generic exception handler prints the message "未知错误" in Chinese only. For an otherwise English-described script, this is a natural-language policy violation unless the file explicitly states that Chinese output is required or allows users to select their preferred language.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The script promises that a password file supplied via --textfile will be deleted, but only performs deletion after successful token retrieval and save. If authentication fails or an exception occurs, the plaintext password file remains on disk, increasing the chance of credential exposure through later access, backups, or logs.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The script emits API error messages in Chinese ("获取Token失败" / "获取Token被拒绝") and later also uses Chinese for unexpected errors, without any user opt-in or locale selection. This is a natural-language policy issue because the skill imposes a specific language on users regardless of their preferences.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

The fallback exception handler prints "未知错误", which forces a Chinese-language user experience even though the rest of the script and CLI help are largely in English. Without opt-in or documentation that this is a region-specific Chinese-only tool, this violates the language/locale policy guidance.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.