Back to skill

Security audit

Csdn Article Publish(CSDN博客文章发布) Skills

Security checks for vulnerabilities and agentic risk

Overview

The skill appears to do what it claims, but it asks users to store live CSDN session cookies and signing headers in a plaintext local config that can modify or publish account content.

Install only if you are comfortable letting a local script use your active CSDN browser session to save, update, or publish articles. Treat csdn_config.json like a password file: keep it outside shared repos, restrict permissions, never paste it into prompts or logs, and refresh or revoke the CSDN session if it may have been exposed. Use draft mode first and confirm article IDs before update or publish 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 (1)

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/csdn_article.js:67
Finding

Reusable CSDN Authentication Credentials Stored in Plaintext

Content
View full analysis

Vulnerability Details

File Location: SKILL.md:27-65, config/config_example.json:1-8, and scripts/csdn_article.js:67-75
Vulnerability Type: Plaintext storage of sensitive authentication material
Risk Level: Medium

The documented workflow directs users to store a CSDN session cookie, API key, nonce, and request signature in a plaintext csdn_config.json file. The application then reads this file without checking or enforcing restrictive file permissions.

Relevant configuration structure from config/config_example.json:1-8:

json
{
  "headers": {
    "Cookie": "your_cookie_here",
    "x-ca-nonce": "xxxxxx",
    "x-ca-signature": "xxxxxxxx",
    "x-ca-signature-headers": "x-ca-key,x-ca-nonce",
    "x-ca-key": "xxxxxxxx"
  }
}

Configuration loading logic from scripts/csdn_article.js:67-75:

javascript
function loadConfig(configPath) {
  const resolvedPath = path.resolve(configPath);
  if (!fs.existsSync(resolvedPath)) {
    log.error(`Config file '${resolvedPath}' not found`);
    process.exit(1);
  }
  return JSON.parse(fs.readFileSync(resolvedPath, 'utf-8'));
}

Technical Analysis

The Cookie, x-ca-key, and signature-related headers are authentication material that may authorize operations against the user's CSDN account. Storing these values in an ordinary plaintext file exposes them to any process or local user that can read the file.

The implementation does not:

  • Validate that the configuration file is owned by the current user.
  • Reject group-readable or world-readable permissions.
  • Create the file with a restrictive mode such as 0600.
  • Support an operating-system credential store.
  • Provide a repository-level ignore rule for csdn_config.json.
  • Warn when the credential file is located inside a version-controlled directory.

Although the repository only contains placeholders and does not contain leaked production credentials, the ...[truncated 1601 chars]

Remediation
View remediation

Remediation Suggestions

  1. Avoid plaintext credential files where possible

    • Read sensitive values from environment variables.
    • Prefer an operating-system credential manager or encrypted secret store.
    • Keep only non-sensitive defaults in the JSON configuration file.
  2. Enforce restrictive permissions

    • On POSIX systems, inspect the file mode before reading it and reject files accessible by group or other users.
    • Require a mode equivalent to 0600.
    • Verify that the credential file is owned by the current user.
  3. Prevent accidental source-control disclosure

    • Add csdn_config.json and equivalent credential filenames to .gitignore.
    • Provide a separate placeholder file such as csdn_config.example.json.
    • Detect whether the selected credential file is tracked by Git and display a blocking error or prominent warning.
  4. Minimize credential lifetime and exposure

    • Recommend using short-lived session material.
    • Avoid printing authentication headers in logs or error messages.
    • Document immediate cookie and API credential rotation after suspected disclosure.
  5. Separate secrets from ordinary settings

    • Keep publishing defaults in the JSON file.
    • Load Cookie, x-ca-key, x-ca-nonce, and x-ca-signature from protected secret sources at runtime.
  6. Harden file handling

    • Resolve symbolic links and reject credential files that point to unexpected or shared locations.
    • If the application creates a credential file in future versions, use an atomic creation operation with exclusive access and mode 0600.
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
  • Prompt InjectionInstruction Override, Hidden Instructions, Exfiltration Commands
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
Findings (16)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description describes an end-to-end CSDN blog publishing skill, including creating, saving, updating, and publishing articles on the CSDN platform. However, the supplied code chunk is a narrow utility that parses Markdown into HTML via a local library. This is only a possible supporting helper for a publishing system, not the described skill itself. There is no evidence of CSDN API calls, browser automation, authentication, draft handling, article management, or publishing logic. Therefore the code’s actual behavior does not accurately represent the declared purpose.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
99% confidence
Finding

This is a clear description-behavior mismatch. The declared purpose says the skill writes and publishes articles to CSDN, including creating, saving drafts, updating, and publishing posts. However, the provided code is a generic third-party Markdown parser/rendering library (Marked). Its functionality is limited to lexing, tokenizing, parsing, and rendering Markdown/HTML. There is nothing in this chunk that authenticates to CSDN, accesses browser/session state, invokes HTTP requests, manipulates CSDN pages, or performs article management actions. Markdown parsing could be a supporting component within a larger CSDN publishing skill, but this code chunk by itself does not implement the declared behavior and instead has a materially different primary purpose.

Content

No source excerpt is available for this finding.

Ssd 3

High
Category
Not specified by scanner
Confidence
97% confidence
Finding

The instructions tell the user to copy live browser request data, including session cookies and request-signing headers, from developer tools for automated reuse. These materials can grant direct authenticated access to the user's CSDN account and may bypass normal credential boundaries, so mishandling or exfiltration could enable unauthorized posting, account abuse, and persistent session compromise.

Content

No source excerpt is available for this finding.

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/csdn_article.js save \

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/csdn_article.js save \

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/csdn_article.js save \

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/csdn_article.js save \

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/csdn_article.js save \

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
node scripts/csdn_article.js save \

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

The skill instructs users to extract and place live authentication material, including Cookie and signing headers, into a local configuration file without prominent credential-handling warnings or safer alternatives. This normalizes copying highly sensitive session artifacts from browser traffic, increasing the risk of account takeover, accidental disclosure in logs/repos, or reuse by other tools on the host.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The document explicitly instructs users to obtain and use live login cookies and signing credentials from browser developer tools, but provides no warning about their sensitivity, storage, or misuse risk. In the context of a publishing skill, these credentials could enable unauthorized account access and article creation or modification if exposed in logs, prompts, or tool state.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The guide explicitly tells users to copy live authentication material, including a session Cookie and signature-related headers, into a local configuration file. In a publishing skill that automates account actions, this creates real credential-handling risk: the file may be stored insecurely, leaked via logs, committed to source control, or reused by other local processes, enabling account takeover or unauthorized posting.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

This bundled marked renderer returns raw HTML tokens unchanged via the html renderer, so untrusted markdown containing embedded HTML can be rendered directly into output HTML. If the skill later displays that output in a browser or webview without a separate sanitizer, an attacker could inject scriptable markup and trigger XSS or content injection.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
84% confidence
Finding

The API reference describes a POST endpoint that can save drafts and publish articles, but it does not clearly warn that invoking it performs state-changing actions on a user's CSDN account. In an agent skill context, insufficient disclosure increases the risk of unintended content publication, especially if the agent triggers the endpoint without strong confirmation or publish-state safeguards.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
83% confidence
Finding

The natural-language content from the troubleshooting sections is exclusively Chinese, which can constitute a language/locale policy issue if the skill is presented to a broader audience without opt-in. There is no note that the skill is China-specific or that Chinese is an intentional, documented locale constraint.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
92% confidence
Finding

The request headers hard-code accept-language to zh-CN,zh;q=0.9, which imposes a specific language/locale behavior for all users. The file does not offer a user opt-in, configuration switch, or explain that this locale restriction is required for a region-specific workflow.

Content

No source excerpt is available for this finding.

Static analysis

No suspicious patterns detected.