Back to skill

Security audit

Weekly Report Email

Security checks for vulnerabilities and agentic risk

Overview

This email-report skill mostly does what it says, but it handles credentials and report contents in ways users should review before installing.

Review this skill before installing. Use an app-specific SMTP password, avoid pasting secrets or sensitive internal details into reports, verify recipients before confirming send, and prefer a version that escapes HTML, restricts temp-file deletion to its own memory directory, stores secrets more safely, and updates nodemailer.

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

Warning
Location
main.js:166
Finding

Unescaped Report Content Permits HTML Injection

Content
View full analysis
${icon} ${desc} ${status}
${detail}
`; } // Content that does not match the expected format is displayed directly return `
${line}
`; ``` Additional affected output locations: ```javascript ${content.section5 ? `
${content.section5}
` : '

(此项暂无内容)

'} ``` ```javascript ${content.section6 ? `
${content.section6}
` : '

(此项暂无内容)

'} ``` ### Technical Analysis The report generator interpolates user-controlled report content directly into an HTML document without HTML encoding or sanitization. Fields such as `desc`, `status`, `detail`, `line`, `content.section5`, and `content.section6` can consequently introduce arbitrary HTML elements and attributes into the generated report. The same underlying pattern is present in other section parsers that construct markup from report text. Input format validation does not provide a security boundary because both formatted and unformatted content is inserted into HTML. An attacker can inject elements such as deceptive links, externally hosted images used for tracking, manipulated visual content, forms, or active HTML features. Most modern email clients block scripts, but this behavior is not universal across preview components and HTML rendering environments. The vulnerability therefore must not be mitigated by relying on recipient-client filtering. ### Attack Path 1. An attacker supplies crafted weekly-report content through one of the collected ...[truncated 1268 chars]
Remediation
View remediation
`, `"`, and `'`. 2. Introduce one centralized escaping function and ensure every section parser uses it: ```javascript function escapeHtml(value) { return String(value) .replace(/&/g, '&') .replace(//g, '>') .replace(/"/g, '"') .replace(/'/g, '''); } ``` 3. Escape parsed values before constructing markup: ```javascript const safeDesc = escapeHtml(desc); const safeStatus = escapeHtml(status); const safeDetail = escapeHtml(detail); ``` 4. Escape unformatted lines and the complete contents of sections 5 and 6 rather than inserting them directly. 5. If limited formatting is required, use a maintained HTML sanitizer with a strict allowlist. Block scripts, event-handler attributes, forms, iframes, unsafe URL schemes, and remote resources. 6. Add security tests using payloads containing `

T09 · Insecure Skill Coding Practices

Warning
Location
main.js:575
Finding

Caller-Controlled Temporary File Path Enables Arbitrary File Deletion

Content
View full analysis
0) { const uniqueCcList = [...new Set(allCcList)]; cc = uniqueCcList.join(','); console.log(`📋 最终抄送人: ${cc}`); } const result = await sendWeeklyReport(report.subject, report.body, recipient, cc); // Delete the temporary file after successful delivery if (result && tempFilePath) { cleanupTempFile(tempFilePath); } return result; } ``` ```javascript function cleanupTempFile(filePath) { if (!filePath) { return false; } try { if (fs.existsSync(filePath)) { fs.unlinkSync(filePath); console.log('✅ 临时文件已删除:', filePath); return true; } ``` ### Technical Analysis `generateAndSendReport()` accepts `tempFilePath` from its caller and passes it directly to `cleanupTempFile()` after successful email delivery. The cleanup function then calls `fs.unlinkSync(filePath)` without canonicalizing the path, checking its parent directory, or validating its filename. The intended target is a generated file under the Skill's `memory/` directory, but this requirement exists only in documentation. It is not enforced by the implementation. Absolute paths and traversal paths such as `../../target` are ...[truncated 1512 chars]
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Privilege EscalationExcessive Permissions, Sudo/Root Execution, Credential Access
  • Supply ChainUnpinned Dependencies, External Script Fetching, Obfuscated Code
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (33)

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- `setup.js`: 首次配置引导

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 · mailer.js (reported line 16)May include surrounding context.

js
// 从当前技能目录的 .env 加载邮箱配置
function loadEnvConfig() {
  const envPath = path.join(__dirname, '.env');
  if (!fs.existsSync(envPath)) {
    return null;
  }

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.js (reported line 36)May include surrounding context.

js
// 从当前技能目录的 .env 加载邮箱配置
function loadEnvConfig() {
  const envPath = path.join(__dirname, '.env');
  if (!fs.existsSync(envPath)) {
    return null;
  }

Known Vulnerable Dependency: nodemailer==6.10.1 — 12 advisory(ies): CVE-2026-82661 (Nodemailer: CRLF injection in Nodemailer List-* header comments allows arbitrary); GHSA-2x7j-588g-ccc2 (Nodemailer: Quadratic (O(n²)) time complexity in addressparser allows remote den); GHSA-8m3c-c648-2xjj (Nodemailer: resolveContent() on a MailMessage bypasses disableFileAccess/disable) +9 more

High
Category
Supply Chain
Confidence
95% confidence
Finding

The lockfile pins nodemailer to version 6.10.1, and the finding cites multiple published advisories affecting that exact version, including header injection, denial-of-service, and content/file-access bypass issues. In a skill whose purpose is to generate and send email, a vulnerable mail library is directly exposed to relevant attack surfaces such as recipient/header parsing and message content handling, which increases the practical risk.

Content

No source excerpt is available for this finding.

Known Vulnerable Dependency: nodemailer==6.10.1 — 12 advisory(ies): CVE-2026-82661 (Nodemailer: CRLF injection in Nodemailer List-* header comments allows arbitrary); GHSA-2x7j-588g-ccc2 (Nodemailer: Quadratic (O(n²)) time complexity in addressparser allows remote den); GHSA-8m3c-c648-2xjj (Nodemailer: resolveContent() on a MailMessage bypasses disableFileAccess/disable) +9 more

High
Category
Supply Chain
Confidence
97% confidence
Finding

The declared nodemailer range can resolve to versions flagged with multiple advisories, including header injection, content access control bypass, and denial-of-service issues. This skill's purpose is generating and sending HTML email, so it directly exercises risky functionality around headers, addresses, and message content, making dependency flaws materially relevant in context.

Content

No source excerpt is available for this finding.

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 · mailer.js (reported line 14)May include surrounding context.

js
const configPath = path.join(__dirname, 'config.json');

// 默认配置模板
// 注意:邮箱配置现在从 .env 读取
const defaultConfig = {
  report: {
    company: '',

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 · mailer.js (reported line 54)May include surrounding context.

js
const configPath = path.join(__dirname, 'config.json');

// 默认配置模板
// 注意:邮箱配置现在从 .env 读取
const defaultConfig = {
  report: {
    company: '',

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 · mailer.js (reported line 78)May include surrounding context.

js
const configPath = path.join(__dirname, 'config.json');

// 默认配置模板
// 注意:邮箱配置现在从 .env 读取
const defaultConfig = {
  report: {
    company: '',

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 · mailer.js (reported line 117)May include surrounding context.

js
const configPath = path.join(__dirname, 'config.json');

// 默认配置模板
// 注意:邮箱配置现在从 .env 读取
const defaultConfig = {
  report: {
    company: '',

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.js (reported line 14)May include surrounding context.

js
const configPath = path.join(__dirname, 'config.json');

// 默认配置模板
// 注意:邮箱配置现在从 .env 读取
const defaultConfig = {
  report: {
    company: '',

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.js (reported line 35)May include surrounding context.

js
const configPath = path.join(__dirname, 'config.json');

// 默认配置模板
// 注意:邮箱配置现在从 .env 读取
const defaultConfig = {
  report: {
    company: '',

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.js (reported line 38)May include surrounding context.

js
const configPath = path.join(__dirname, 'config.json');

// 默认配置模板
// 注意:邮箱配置现在从 .env 读取
const defaultConfig = {
  report: {
    company: '',

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.js (reported line 198)May include surrounding context.

js
const configPath = path.join(__dirname, 'config.json');

// 默认配置模板
// 注意:邮箱配置现在从 .env 读取
const defaultConfig = {
  report: {
    company: '',

Credential Access

High
Category
Privilege Escalation
Confidence
92% confidence
Finding

This function is explicitly responsible for saving SMTP credentials, including the password, into a local .env file. In the context of an email-sending skill, collecting credentials is expected, but persisting them in plaintext materially increases risk of disclosure through local compromise, backups, logs, or accidental repository inclusion.

Content

Scanner excerpt · setup.js (reported line 58)May include surrounding context.

js
}
}

// 保存 .env 配置
function saveEnvConfig(smtpHost, smtpPort, smtpSecure, smtpUser, smtpPass, smtpFrom) {
  try {
    const envContent = `# SMTP 配置(发邮件)

Credential Access

High
Category
Privilege Escalation
Confidence
89% confidence
Finding

Writing the generated SMTP secret material to envPath with fs.writeFileSync stores sensitive credentials unencrypted on disk. Although there is no sign of exfiltration, the action broadens the attack surface because any actor with filesystem access or accidental sync/commit exposure can recover the SMTP password.

Content

Scanner excerpt · setup.js (reported line 70)May include surrounding context.

js
SMTP_FROM=${smtpFrom}
`;
    fs.writeFileSync(envPath, envContent, 'utf-8');
    console.log('✅ 邮箱配置已保存到 .env');
    return true;
  } catch (error) {
    console.error('邮箱配置保存失败:', error.message);

Ssd 3

Medium
Category
Not specified by scanner
Confidence
90% confidence
Finding

The skill instructs the agent to retain and later reuse essentially all user-provided free-form content unless the user explicitly uses a narrow set of negation words. This increases the chance that sensitive, irrelevant, or accidentally pasted data will be propagated into the final report/email without meaningful minimization or review safeguards.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The workflow instructs the agent to compute the reporting window as '本周四 到 下周三' and a due date of '下周周四', but the later '邮件规则' section defines the time range as '上周四 到 本周三' and uses a different week-number rule. These are active contradictions in the documented intent, not mere omissions, and could cause the agent to generate a report for the wrong week.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The instructions state that all time calculations '必须是东八区', which imposes a fixed locale/timezone behavior. The document does not offer the user a choice or clearly justify that the skill is intended only for a China-specific environment, so this is a natural-language locale policy issue.

Content

No source excerpt is available for this finding.

Ssd 3

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The workflow requires writing all collected content to a local temporary file and then using it in an email, which expands the exposure surface for sensitive user data. Even if temporary, plaintext storage can be read by other processes, persist longer than expected after failures, or be mistakenly retained and disclosed.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The file’s header comments and all user-facing status/error messages are written in Chinese, with no indication that language selection is optional or that the skill is intentionally limited to a Chinese-speaking environment. This creates a natural-language policy concern because the skill effectively enforces a specific language without user opt-in.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
78% confidence
Finding

The manifest describes interactive weekly report collection and email delivery, but does not mention reading local secret files or credential management. Accessing and parsing a .env file for SMTP credentials is a separate capability involving local sensitive data access, which is not obviously implied by the stated user-facing purpose alone.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
94% confidence
Finding

Natural-language strings throughout the file are fixed in Chinese, and the date logic explicitly converts to East China time for report calculations. This enforces a specific language and locale without offering opt-in, selection, or an explicitly documented regional constraint.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The manifest describes interactive weekly report collection, week/date calculation, and HTML email generation. Invoking child_process to execute python3 introduces process-execution capability that is unrelated to the declared purpose, especially since week-number calculation can be performed directly in JavaScript.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The skill logs a preview of user-supplied weekly report content to the console, which may include sensitive business status, blockers, project names, or personal reflections. Console logs are often collected centrally or exposed to operators, so this creates an unintended data disclosure channel without user awareness or consent.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
85% confidence
Finding

This code transmits the generated weekly report and recipient/CC information via sendWeeklyReport, which is a network operation involving user data. In this file there is no confirmation prompt or clear user-facing warning that report contents will be sent externally.

Content

No source excerpt is available for this finding.