Back to skill

Security audit

WorkBuddy 自定义皮肤技能

Security checks for vulnerabilities and agentic risk

Overview

This is a disclosed WorkBuddy theming skill, but it changes WorkBuddy’s installed app.asar and uses a scheduled PowerShell restart path with weak integrity and cleanup controls.

Review carefully before installing. Only use this on a personal WorkBuddy install where you are comfortable modifying the application package, invalidating signatures/updates until restore, and restarting WorkBuddy. Do not run it with untrusted theme packages or reference files, and verify the patched ASAR and backup path before applying.

Vulnerability Patterns
  • System PersistenceInstalls backdoors, hooks, services, or scheduled tasks that survive the run
  • Tool Hijacking and SpoofingModifies or replaces tools so legitimate-looking calls execute attacker logic
  • Insecure DependenciesIntroduces malicious components through unsafe dependency sources
  • 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
Findings (6)

T06 · System Persistence

Error
Location
scripts/apply.js:47
Finding

Scheduled Task Persistence Without Cleanup

Content
View full analysis
等 2s -> node apply.js --install) function runSchedule() { const skillDir = path.dirname(__dirname); const tmpDir = path.join(process.env.TEMP || os.tmpdir(), 'wb-dream-skin'); fs.mkdirSync(tmpDir, { recursive: true }); const ps1 = path.join(tmpDir, 'kill-restart.ps1'); const js = path.join(__dirname, 'apply.js'); const node = process.execPath; const ps = [ '$ErrorActionPreference="SilentlyContinue"', `Get-CimInstance Win32_Process -Filter "Name='WorkBuddy.exe'" | Where-Object { $_.CommandLine -notmatch '--type=' -and $_.CommandLine -notmatch 'codebuddy' -and $_.CommandLine -notmatch 'app.asar.main' -and $_.CommandLine -notmatch '--require' } | ForEach-Object { Stop-Process -Id $_.ProcessId -Force }`, 'Start-Sleep -Seconds 2', `& '${node}' '${js}' --install`, ].join('\n'); fs.writeFileSync(ps1, ps, 'utf8'); log(skillDir, `wrote temp ps1: ${ps1}`); const taskName = 'ApplyWorkBuddySkin'; const next = new Date(Date.now() + 60 * 1000); const t = next.toTimeString().slice(0, 8); const tr = `powershell.exe -NoProfile -ExecutionPolicy Bypass -File ${ps1}`; log(skillDir, 'scheduling detached install+restart task'); execFile('schtasks', ['/delete', '/tn', taskName, '/F'], { windowsHide: true }, () => { execFile('schtasks', ['/create', '/tn', taskName, '/tr', tr, '/sc', 'once', '/st', t, '/F'], { windowsHide: true }, (err, stdout, stderr) => { if (stdout) log(skillDir, `schedule stdout: ${stdout.trim()}`); if (stderr) log(skillDir, `schedule stderr: ${stderr.trim()}`); if (err) log(skillDir, `schedule error: ${err.message}`); else log(skillDir, `scheduled install task at ${t}`); }); }); } ``` ### Technical Analysis The Skill creates a Wind ...[truncated 2045 chars]
Remediation
View remediation

T07 · Tool Hijacking and Spoofing

Error
Location
scripts/apply.js:28
Finding

Predictable Temporary Archive Can Be Replaced Before Host Installation

Content
View full analysis
{ const exe = locateExe(); spawn(exe, [], { detached: true, windowsHide: false, stdio: 'ignore' }).unref(); log(skillDir, `relaunched WorkBuddy from ${exe}`); }, 800); } ``` The corresponding default output path is predictable: ```js if (!a.out) { a.out = path.join(os.tmpdir(), 'wb-dream-skin', '_patched.asar'); fs.mkdirSync(path.dirname(a.out), { recursive: true }); } ``` ### Technical Analysis The patched archive is written to a fixed path under the user-controlled temporary directory. A later scheduled process copies that archive into WorkBuddy’s installation directory. The installation branch checks only whether the file exists; it does not verify a cryptographic digest, file ownership, archive identity, reparse-point status, or whether it is the same file previously generated and validated by `asar-patch.js`. The separation between patch generation and delayed installation creates a time-of-check/time-of-use window. Validation in the patcher does not protect the subsequent copy if another process replaces `_patched.asar` after validation. Because `app.asar` contains executable Electron application code, replacing it is substantially more powerful than changing appearance data. ### Attack Path ...[truncated 1053 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Error
Location
scripts/gen-static-css.js:31
Finding

Theme Metadata Permits Directory Traversal and Unrestricted CSS Injection

Content
View full analysis
global css = css.replace(/html\.dream-host-workbuddy/g, ''); css = css.replace(/:root\.dream-host-workbuddy/g, ':root'); // 2) inline hero/texture (with or without fallback) if (hero) css = css.replace(/var\(--dream-hero[^)]*\)/g, hero); if (texture) css = css.replace(/var\(--dream-texture[^)]*\)/g, texture); fs.writeFileSync(a.out, css, 'utf8'); ``` Bundled theme metadata demonstrates that paths outside the theme directory are accepted: ```json "images": { "hero": "../../assets/dahua_scene.png", "texture": "../../assets/dahua_scene.png" } ``` ### Technical Analysis The generator resolves CSS and image paths supplied by `theme.json` without checking that their canonical paths remain inside the selected theme directory. Values such as `../../sensitive-file` can therefore escape the theme package. The implementation also reads theme CSS verbatim, strips its scope prefixes, and prepares it for global injection into WorkBuddy. It does not parse or reject: - `@import` directives; - HTTP or protocol-relative `url(...)` resources; - unexpected `file:` references; - HTML-breaking content relevant to pre ...[truncated 1502 chars]
Remediation
View remediation
` rather than accepting arbitrary metadata paths. 5. Validate image extensions, MIME signatures, dimensions, and maximum file sizes before Base64 encoding. 6. Parse CSS with a maintained parser and allow only an explicit subset required for theming. 7. Reject `@import`, `http:`, `https:`, protocol-relative URLs, `file:`, and all URL schemes other than validated local assets converted to `data:` URIs. 8. Preserve a restrictive theme scope instead of removing scope selectors globally. 9. Block selectors or properties capable of hiding or impersonating permission dialogs, update warnings, authentication controls, or other sensitive UI. 10. Update bundled themes so their assets reside inside each theme directory rather than relying on `../../assets/...`. ]]>

T09 · Insecure Skill Coding Practices

Error
Location
scripts/make-preview.js:146
Finding

Preview Generator Allows HTML and Script Injection

Content
View full analysis
'); process.exit(2); } const css = fs.readFileSync(args.skin, 'utf8'); const name = args.name || path.basename(args.skin, '.css'); const out = args.out || path.resolve(path.dirname(args.skin), 'preview.html'); const heroUri = args.hero ? toDataUri(args.hero) : ''; const avatarUserUri = args.avatarUser ? toDataUri(args.avatarUser) : ''; const avatarAiUri = args.avatarAi ? toDataUri(args.avatarAi) : ''; let heroOverride = ''; if (heroUri) { heroOverride = ` body::before { background-image: linear-gradient(180deg, rgba(60, 25, 60, 0.25) 0%, rgba(12, 5, 20, 0.55) 100%), url("${heroUri}") !important; }`; } const html = ` WorkBuddy 皮肤预览 · ${name} ${css} ${heroOverride} ${layoutCss()} ${mockUi(name, avatarUserUri, avatarAiUri)} `; fs.writeFileSync(out, html, 'utf8'); console.log('✔ 预览已生成 → ' + out + (heroUri ? '(含背景+头像)' : '')); } ``` ### Technical Analysis The generator directly interpolates the complete contents of a skin file into a `` element. It also interpolates `name` into the document title and into markup returned by `mockUi()` without contextual HTML escaping. A malicious CSS file can contain a sequence such as ``, which terminates the style context and introduces executable markup. A crafted name can similarly break out of title or body text contexts. The Skill’s documented workflow asks the Agent to generate and present the preview, making opening the result ...[truncated 1064 chars]
Remediation
View remediation

T09 · Insecure Skill Coding Practices

Warning
Location
scripts/lib/png-palette.js:14
Finding

Unbounded PNG Decompression and Memory Allocation

Content
View full analysis
Remediation
View remediation

T08 · Insecure Dependencies

Warning
Location
scripts/asar-patch.js:41
Finding

Hard-Coded Unverified External JavaScript Dependencies

Content
View full analysis
Remediation
View remediation
Vulnerability Patterns
  • Data ExfiltrationExternal Transmission, Env Variable Harvesting, File System Enumeration
  • Excessive AgencyUnrestricted Tool Access, Autonomous Decision Making, Scope Creep
  • Trigger AbuseOverly Broad Trigger, Shadow Command Trigger, Keyword Baiting Trigger
  • MCP Least PrivilegeUnderdeclared Capability, Wildcard Permission, Missing Permission Declaration
  • MCP Tool PoisoningHidden Instructions, Unicode Deception, Parameter Description Injection
Findings (25)

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description emphasizes a deep skinning mechanism that patches WorkBuddy's packaged app files to inject CSS into real semantic classes because runtime injection is blocked. The supplied code does something materially different: it parses CLI arguments, chooses or derives a palette from keywords or a reference image, generates CSS text, and writes that CSS to an output file. The generated CSS explicitly states it '仅覆盖 --vscode-* 变量 + 一层装饰背景,不动任何官方文件' and indeed only sets VS Code theme variables and some root/accent variables, plus body pseudo-elements for background/text. There is no code for locating or editing app.asar, creating backups, restoring original files, or patching semantic WorkBuddy class selectors. This is a substantial description-behavior mismatch in the core capability and implementation approach.

Content

No source excerpt is available for this finding.

Tp4

High
Category
MCP Tool Poisoning
Confidence
98% confidence
Finding

The declared description emphasizes an operational skin-application tool that patches WorkBuddy itself via minimal app.asar modification, including backup and restore behavior. The supplied code does none of that. It parses CLI arguments, reads a CSS file, optionally embeds local image assets as data URIs, constructs mock WorkBuddy-like HTML/CSS, and writes a preview.html file. This is related to skin development, but it is only a preview generator, not an injector or patcher. Therefore the code chunk materially differs from the declared primary purpose and omits the key claimed capabilities.

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

md
- `scripts/generate-skin.js` — 一句话/参考图 → 配色背景 CSS(含 `--text` 自定义文字、经典主题复制);依赖 `lib/png-palette.js`。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- `scripts/generate-skin.js` — 一句话/参考图 → 配色背景 CSS(含 `--text` 自定义文字、经典主题复制);依赖 `lib/png-palette.js`。

Ae1

High
Category
analysis-evasion
Confidence
100% confidence
Finding

Referenced artifact was not completely inspected

Content

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

md
- `scripts/make-preview.js` — 界面仿真预览(自包含 HTML)。

Missing User Warnings

High
Category
Not specified by scanner
Confidence
96% confidence
Finding

The manifest explicitly states that the skill performs 'minimal byte surgery' on the installed application's app.asar to inject CSS, yet it does not surface a prominent warning about modifying packaged application files. This is dangerous because it alters application integrity, can break updates or startup, may bypass expected hardening controls, and conditions users to accept invasive local modifications without informed consent.

Content

No source excerpt is available for this finding.

Missing User Warnings

High
Category
Not specified by scanner
Confidence
98% confidence
Finding

The code silently creates a one-time scheduled task that runs a PowerShell script to kill and restart the application, with no visible user disclosure. Hidden task scheduling is a classic execution and persistence technique, and in this context it materially increases risk because it combines privileged orchestration, stealth, and modification of executable app resources.

Content

No source excerpt is available for this finding.

Undeclared Tool Scope

Medium
Category
MCP Least Privilege
Confidence
90% confidence
Finding

The skill explicitly describes operations that read environment variables and auto-locate binaries and installation paths, but it declares no tool scope or permission boundaries. In an agent ecosystem, missing explicit permissions increases the chance of unintended access to local environment data and execution context, especially because the skill also instructs file modification and process control.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
96% confidence
Finding

The trigger list is very broad and contains generic terms like 'theme', 'skin', and 'customize appearance', which can cause the skill to activate in contexts the user did not intend. Because this skill's documented behavior includes host-application modification and restart steps, accidental invocation materially increases risk compared with a harmless read-only skill.

Content

No source excerpt is available for this finding.

Vague Triggers

Medium
Category
Not specified by scanner
Confidence
93% confidence
Finding

The trigger list includes very generic phrases such as “主题”, “皮肤”, “theme”, and “customize appearance”, which can cause the skill to activate for broad, ordinary appearance-related requests. In this skill’s context, accidental activation is more dangerous because the manifest advertises direct modification of app.asar, so an imprecise trigger can lead users into a workflow that changes installed application files when they did not intend that level of system impact.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This markdown file contains user-facing natural language exclusively in Chinese, and there is no indication that the user can choose another language or that the content is intentionally limited to a Chinese-speaking audience. Under the policy rule for language or locale constraints, forcing a specific language without opt-in is a natural-language policy violation.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

This reference document states that the interface colors are '全部由' CSS variables on :root and can be skinned by overriding those variables. That directly contradicts the manifest description, which says WorkBuddy components do not consume --vscode-* variables and that the skill therefore targets semantic classes like .wb-home-header and .chat-container instead.

Content

No source excerpt is available for this finding.

Missing User Warnings

Medium
Category
Not specified by scanner
Confidence
98% confidence
Finding

The script directly overwrites WorkBuddy's app.asar with a patched copy from a temp directory, permanently altering executable application contents at runtime. Replacing a packaged application archive is equivalent to code injection into the app and creates a high-risk path for tampering, persistence, application compromise, and breakage without informed user approval.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This code creates a scheduled task that launches PowerShell with ExecutionPolicy Bypass and then invokes a Node script to replace the application's app.asar and relaunch the app. That is a powerful persistence/execution mechanism well beyond simple theme generation, and if the temp script or patched archive is tampered with it can be abused for arbitrary code execution under the user's context.

Content

No source excerpt is available for this finding.

Context-Inappropriate Capability

Medium
Category
Not specified by scanner
Confidence
95% confidence
Finding

The PowerShell payload enumerates WorkBuddy processes and forcefully terminates them based on command-line filtering, giving the skill process-control capability unrelated to merely generating CSS. Forced process termination can cause data loss, disrupt user activity, and broadens the blast radius if the logic is reused or altered to target additional processes.

Content

No source excerpt is available for this finding.

Intent-Code Divergence

Medium
Category
Not specified by scanner
Confidence
80% confidence
Finding

The generated banner comment says the skin 'only overrides --vscode-* variables' and 'does not touch any official files', implying a narrowly scoped, self-contained theme overlay. However, elsewhere the script emits CSS that references arbitrary local background images via file:///..., making the output depend on external local files rather than being limited to variable overrides alone.

Content

No source excerpt is available for this finding.

Description-Behavior Mismatch

Medium
Category
Not specified by scanner
Confidence
89% confidence
Finding

The file header and generated CSS banner describe this script as a skin CSS generator with zero external dependencies and state it only outputs CSS. In practice, when a JPG/JPEG reference image is provided, the script spawns the external convert binary to transform the image before palette extraction, which is behavior beyond simple CSS generation and contradicts the declared implementation scope.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Medium
Category
Not specified by scanner
Confidence
97% confidence
Finding

This CSS replaces visible UI header/title text with hard-coded Chinese strings via pseudo-elements and by zeroing the original text size. That changes product-facing labels without user consent or locale awareness, which can mislead users, break accessibility/translation expectations, and create UI integrity issues even if the theme is otherwise cosmetic.

Content

No source excerpt is available for this finding.

Missing User Warnings

Low
Category
Not specified by scanner
Confidence
82% confidence
Finding

The code derives installation and temp paths from environment/system state and writes a backup copy of the application package to disk. While backup creation is less risky than deletion, it still modifies user system state and the file contains no visible user-facing disclosure beyond internal logging.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
94% confidence
Finding

The file’s user-facing natural language is entirely in Chinese, including the top-level usage documentation and generated output labels, with no indication that other languages are supported or that Chinese is an intentional locale-specific constraint. Under the policy, forcing a specific language without user opt-in is a natural-language locale issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

This file contains natural-language comments and error messages in Chinese, including purpose descriptions and runtime errors, with no indication that the skill is intentionally limited to Chinese-speaking users. Under the policy, forcing a specific language without user opt-in or justification is a locale/language policy concern.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
86% confidence
Finding

The thrown error text is user-visible natural language and is only provided in Chinese. Because the file does not offer a language choice or document a Chinese-only scope, this creates a language policy issue.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
85% confidence
Finding

These error messages communicate supported PNG formats only in Chinese. Without user opt-in or documentation that the tool is region/language-specific, this is a natural-language policy violation under the language/locale rule.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
93% confidence
Finding

The generated document hard-codes lang="zh", which imposes a specific language/locale choice in the output. The file does not indicate that this is optional, user-configurable, or required for a region-specific purpose.

Content

No source excerpt is available for this finding.

Natural-Language Policy Violations

Low
Category
Not specified by scanner
Confidence
90% confidence
Finding

This stylesheet replaces visible header text with hard-coded Chinese strings via CSS pseudo-elements, including "大话西游 🌙 WorkBuddy", "大话西游 · 经典界面", and "身披金甲圣衣,脚踩七色祥云 ✦". That imposes a specific language/locale in the UI without offering a user choice or documenting an opt-in.

Content

No source excerpt is available for this finding.