Back to skill

Security audit

Upload Markdown to Lexiang

Security checks for vulnerabilities and agentic risk

Overview

The skill does what it says, but its handling of saved Lexiang tokens has a real local file-safety weakness users should review before installing.

Install only if you need a Lexiang Markdown uploader and are comfortable giving it a personal Lexiang MCP token that can create or update pages available to that account. Keep credential files in a private user-owned directory, avoid --credential-file or LEXIANG_UPLOAD_CREDENTIALS paths in shared directories, use --dry-run first, and verify --entry-id before overwriting an existing page.

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
scripts/lexiang_upload.py:175
Finding

Insecure Creation of a Predictable Temporary Credential File

Content
View full analysis
.tmp`. It writes the plaintext MCP token using `Path.write_text()` before applying mode `0600`. When the temporary file does not already exist, its initial permissions are determined by the process umask. Under a common umask of `0022`, it may initially be created with mode `0644`. This creates a window between `write_text()` and `chmod()` during which another local account with sufficient directory and file access could read the token. The routine also does not use exclusive creation or no-follow semantics. If an attacker can modify the selected credential directory, the attacker can pre-create the predictable temporary path as a symbolic link. `Path.write_text()` follows symbolic links, allowing the linked file to be truncated and overwritten with credential data, provided the uploader process already has permission to write to that target. The subsequent `chmod()` also follows the link. The default credentials directory is normally user-owned, which reduces practical exposure. However, the application explicitly supports arbitrary destinations through `--credential-file` and `LEXIANG_UPLOAD_CREDENTIALS`. A user may therefore select a shared, group-writable, or otherwise attacker-controlled directory. ### Attack Path #### Credential disclosure through the creation window 1. The victim selects a c ...[truncated 2113 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
Findings (13)

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 · README.md (reported line 47)May include surrounding context.

python3 scripts/lexiang_upload.py auth logout [--profile NAME | --credential-file PATH]

text

default profile 的凭证路径保持为 `~/.config/lexiang-upload/credentials.json`;
显式 `--profile default` 也使用该旧路径。命名 profile 使用
`~/.config/lexiang-upload/profiles/<profile>.json`,名称仅允许
`[A-Za-z0-9._-]`。所有 auth 子命令和 upload 均支持 `--profile NAME` 与

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 · SKILL.md (reported line 61)May include surrounding context.

python3 scripts/lexiang_upload.py auth logout [--profile NAME | --credential-file PATH]

text

default profile 的凭证路径保持为 `~/.config/lexiang-upload/credentials.json`;
显式 `--profile default` 也使用该旧路径。命名 profile 使用
`~/.config/lexiang-upload/profiles/<profile>.json`,名称仅允许
`[A-Za-z0-9._-]`。所有 auth 子命令和 upload 均支持 `--profile NAME` 与

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 · SKILL.md (reported line 79)May include surrounding context.

python3 scripts/lexiang_upload.py auth logout [--profile NAME | --credential-file PATH]

text

default profile 的凭证路径保持为 `~/.config/lexiang-upload/credentials.json`;
显式 `--profile default` 也使用该旧路径。命名 profile 使用
`~/.config/lexiang-upload/profiles/<profile>.json`,名称仅允许
`[A-Za-z0-9._-]`。所有 auth 子命令和 upload 均支持 `--profile NAME` 与

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 · references/cli-contract.md (reported line 30)May include surrounding context.

python3 scripts/lexiang_upload.py auth logout [--profile NAME | --credential-file PATH]

text

default profile 的凭证路径保持为 `~/.config/lexiang-upload/credentials.json`;
显式 `--profile default` 也使用该旧路径。命名 profile 使用
`~/.config/lexiang-upload/profiles/<profile>.json`,名称仅允许
`[A-Za-z0-9._-]`。所有 auth 子命令和 upload 均支持 `--profile NAME` 与

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 · references/cli-contract.md (reported line 97)May include surrounding context.

python3 scripts/lexiang_upload.py auth logout [--profile NAME | --credential-file PATH]

text

default profile 的凭证路径保持为 `~/.config/lexiang-upload/credentials.json`;
显式 `--profile default` 也使用该旧路径。命名 profile 使用
`~/.config/lexiang-upload/profiles/<profile>.json`,名称仅允许
`[A-Za-z0-9._-]`。所有 auth 子命令和 upload 均支持 `--profile NAME` 与

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 · scripts/lexiang_upload.py (reported line 37)May include surrounding context.

python
python3 scripts/lexiang_upload.py auth logout [--profile NAME | --credential-file PATH]
```

default profile 的凭证路径保持为 `~/.config/lexiang-upload/credentials.json`;
显式 `--profile default` 也使用该旧路径。命名 profile 使用
`~/.config/lexiang-upload/profiles/<profile>.json`,名称仅允许
`[A-Za-z0-9._-]`。所有 auth 子命令和 upload 均支持 `--profile NAME` 与

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 · scripts/lexiang_upload.py (reported line 897)May include surrounding context.

python
python3 scripts/lexiang_upload.py auth logout [--profile NAME | --credential-file PATH]
```

default profile 的凭证路径保持为 `~/.config/lexiang-upload/credentials.json`;
显式 `--profile default` 也使用该旧路径。命名 profile 使用
`~/.config/lexiang-upload/profiles/<profile>.json`,名称仅允许
`[A-Za-z0-9._-]`。所有 auth 子命令和 upload 均支持 `--profile NAME` 与

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 · tests/test_lexiang_upload.py (reported line 144)May include surrounding context.

python
python3 scripts/lexiang_upload.py auth logout [--profile NAME | --credential-file PATH]
```

default profile 的凭证路径保持为 `~/.config/lexiang-upload/credentials.json`;
显式 `--profile default` 也使用该旧路径。命名 profile 使用
`~/.config/lexiang-upload/profiles/<profile>.json`,名称仅允许
`[A-Za-z0-9._-]`。所有 auth 子命令和 upload 均支持 `--profile NAME` 与

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
94% confidence
Finding

The skill instructs use of shell, network, local file access, environment-variable based discovery, and credential handling, but it declares no explicit tool scope or permissions boundaries. That makes the operational capability broader and less auditable than the metadata suggests, increasing the chance an agent invokes it with excessive privileges or without informed approval.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This Python file contains multiple user-facing exception messages in Chinese (for example at L125, L128, L130, L303, L309, L321, L331, L362-L384, and L392), while the module docstrings are in English. That creates a fixed-language user experience with no visible language selection or documented justification, which matches the locale-policy violation criteria.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
87% confidence
Finding

This markdown file states that the skill can "创建或覆盖 page", which is a potentially destructive remote write operation. The README provides usage examples for upload and update actions but does not include any caution, confirmation expectation, or warning that existing online content may be replaced.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
81% confidence
Finding

The file explains obtaining personal credentials, storing profiles, and selecting credential files, which involves handling sensitive authentication material. Although this is part of the skill's purpose, the README lacks any explicit warning to keep tokens private, avoid sharing exported credential JSON, or secure files stored under the config directory.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
95% confidence
Finding

This file contains extensive hard-coded Chinese user-facing error and prompt strings, starting here and continuing throughout the CLI flow. The skill does not appear to offer any user opt-in or locale selection, which can violate a language/locale policy that requires respecting user language choice.

Content

No source excerpt is available for this finding.

Static analysis

Detected: suspicious.exposed_secret_literal

File appears to expose a hardcoded API secret or token.

Critical
Code
suspicious.exposed_secret_literal
Location
tests/test_lexiang_upload.py:136