T05 · Unauthorized Access and Privilege Escalation
- Location
scripts/wb_audit.py:35- Finding
Overly Broad Credential File Discovery and Content Inspection
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
This is a mostly coherent local security-audit skill, but it deserves review because its scripts can broadly inspect credential-bearing files and copy sensitive WorkBuddy state into a temporary sandbox.
Review the script scope before installing or running it. Use the audit only on WorkBuddy/workspace directories you intend to inspect, and treat generated reports as sensitive because they can reveal secret locations. Run wb_recovery_full.py first in dry-run mode and use --execute only if you accept temporary copying of identity, memory, connector metadata, and snapshot files.
scripts/wb_audit.py:35Overly Broad Credential File Discovery and Content Inspection
scripts/wb_recovery_full.py:28Sensitive Agent State Copied Through a Predictable Temporary Directory
The skill claims to provide security and stability analysis, but the detected behavior includes generating avatar graphics and writing PNG files—actions unrelated to the declared mission—while lacking implementation for many promised security functions. This mismatch is dangerous because users and platforms may trust the skill with sensitive operational tasks under false assumptions, while hidden or undeclared behaviors can expand attack surface and obscure what the skill actually does.
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
TEAMS = ["wb-safe-team"]
# 敏感文件名(凭据官七类位置精简为文件名命中,避免依赖包噪声)
SENSITIVE_NAMES = [".env", ".env.local", "credentials", "credential",
"secrets", "token", "tokens", "*.key", "id_rsa", "id_ed25519"]
# 噪声目录(依赖包/缓存),凭据官扫描时剪枝
EXCLUDE_DIRS = {"node_modules", ".git", "site-packages", "__pycache__",
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
TEAMS = ["wb-safe-team"]
# 敏感文件名(凭据官七类位置精简为文件名命中,避免依赖包噪声)
SENSITIVE_NAMES = [".env", ".env.local", "credentials", "credential",
"secrets", "token", "tokens", "*.key", "id_rsa", "id_ed25519"]
# 噪声目录(依赖包/缓存),凭据官扫描时剪枝
EXCLUDE_DIRS = {"node_modules", ".git", "site-packages", "__pycache__",
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
TEAMS = ["wb-safe-team"]
# 敏感文件名(凭据官七类位置精简为文件名命中,避免依赖包噪声)
SENSITIVE_NAMES = [".env", ".env.local", "credentials", "credential",
"secrets", "token", "tokens", "*.key", "id_rsa", "id_ed25519"]
# 噪声目录(依赖包/缓存),凭据官扫描时剪枝
EXCLUDE_DIRS = {"node_modules", ".git", "site-packages", "__pycache__",
The scanner opens and reads .env files to determine whether they contain real secret assignments. Although it avoids printing the values, this still accesses raw secret material in memory and processes files under broad home-directory paths, increasing exposure if the tool is run in an over-privileged context or later modified/logged unsafely.
tag = _classify(fp)
if tag is None: continue
info = "sensitive-name:%s" % pat
if f.endswith(".env"):
# 精确:是否含敏感 key(API_KEY/SECRET/PASSWORD/TOKEN)的真实赋值
# 逐行判定,避免 \s 跨行误匹配;读值但绝不输出;URL 配置不算敏感赋值
try:
The content scan walks the workspace and inspects lines in .md, .txt, .json, .py, and .env files for secret patterns. This is legitimate for secret discovery, but it necessarily reads potential credentials from many files and could surface sensitive line locations in reports, which becomes risky in an agent skill context where users may over-trust 'offline audit' claims.
# B2 内容模式(仅工作目录,避免依赖包噪声)
for root, _, files in os.walk(WB):
for f in files:
if f.endswith((".md", ".txt", ".json", ".py", ".env")):
fp = os.path.join(root, f)
try:
for i, line in enumerate(io.open(fp, encoding="utf-8", errors="ignore"), 1):
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
- 发现次数: 1 次
- 详细列表:
- `scripts/wb_recovery_full.py:72` — `shutil.rmtree(SB)`:仅删除**自身创建的临时沙箱目录**(`$TEMP/wb_recovery_full_sandbox`),且仅 `--execute` 显式授权后触发,默认 dry-run 不触碰任何数据。删除目标为程序自建的临时目录,非系统/用户路径。**判定:安全(删除范围受控)。**
- 敏感路径读取: `.ssh` / `.gnupg` / `/etc/passwd` / `.aws` / `.gcloud` / 环境变量文件 — **0 命中**。
- 凭据扫描逻辑(`wb_audit.py` cred_scan)只**报告文件位置与行号**,**永不回显密钥值**,且无任何外发通道。**判定:符合「只报位置不回显值」设计,安全。**
### 网络请求检查
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
- **判定:纯本地闭环,零网络行为。**
### 远程脚本深度分析
- 不适用:未发现任何自动下载 + 执行远程脚本的模式(无 `curl | bash`、无 `wget | sh`、无远程 URL)。
### 依赖安装风险检查
- **全局安装检测**: 未发现(无 `pip install` / `npm install -g` / `gem install` 等)
Remote code is downloaded and executed. This bypasses code review and could introduce malicious code.
- **判定:纯本地闭环,零网络行为。**
### 远程脚本深度分析
- 不适用:未发现任何自动下载 + 执行远程脚本的模式(无 `curl | bash`、无 `wget | sh`、无远程 URL)。
### 依赖安装风险检查
- **全局安装检测**: 未发现(无 `pip install` / `npm install -g` / `gem install` 等)
The skill advertises operational behaviors involving local scripts, file access, shell execution, and possible environment-variable handling, but it does not declare any explicit tool scope such as permissions or allowed-tools. This weakens least-privilege controls and makes it harder for a host platform or reviewer to bound what the skill may do, increasing the risk of unintended file access, command execution, or credential exposure if the skill is invoked in a permissive runtime.
The trigger phrases are broad and include common operational language, which can cause the skill to activate in situations the user did not intend. In a skill that discusses credentials, recovery, shell-backed scripts, and configuration changes, accidental invocation increases the chance of unnecessary sensitive guidance, confusing actions, or prompting workflows that touch files, secrets, or system state without clear user intent.
The module documentation explicitly describes the tool as "纯本地、只读诊断" and the usage comment says normal execution will generate a report and update the baseline. In implementation, the script writes both audit_baseline.json and a markdown report file, which are side effects inconsistent with a read-only claim.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
def ps(cmd):
try:
r = subprocess.run(["powershell", "-NoProfile", "-Command", cmd],
capture_output=True, text=True, timeout=30)
return r.stdout.strip()
except Exception as e:
Code scans file system directories looking for sensitive files. This could be reconnaissance for credential theft.
hits = []
# B1 敏感文件名(.workbuddy 范围),剪枝依赖包噪声 + 分级
for pat in SENSITIVE_NAMES:
for root, dirs, files in os.walk(os.path.join(HOME, ".workbuddy")):
_prune(dirs)
if "plugins/cache" in root.replace("\\", "/"): # 第三方包缓存跳过
continue
The destination path is derived from the TEMP environment variable via SB and then used for file writes without validating or constraining the resolved path. An attacker who can influence the environment could redirect copies into an unintended location, causing sensitive recovery data to be written outside the expected sandbox and potentially exposed or overwritten.
shutil.copytree(s, dst)
else:
os.makedirs(os.path.dirname(dst), exist_ok=True)
shutil.copy(s, dst)
copied += 1
except Exception as e:
print(" 复制失败 %s: %s" % (s, e))
The report claims '0 issues' and a perfect score while later acknowledging command execution and a deletion-capable script. Even if those capabilities are framed as controlled or dry-run, the contradictory audit language can mislead reviewers into underestimating operational risk and approving the package without proper scrutiny.
Describing the package as 'pure teaching/methodology + read-only diagnostic scripts' is inaccurate because the same document states a recovery script can delete a directory when run with an execute flag. This kind of understatement is dangerous because users may trust the package with fewer safeguards than they would apply to tooling that performs destructive filesystem actions.
This markdown skill file presents all operational instructions in Chinese and does not indicate that users may choose another language or locale. Under the policy rule for natural-language constraints, forcing a specific language without opt-in is a policy concern.
This markdown file contains user-facing instructions only in Chinese, which can amount to a language policy issue when no user opt-in or alternative locale is provided. The document also does not state that the skill is intentionally limited to a Chinese-speaking or region-specific audience.
The file contains all user-visible labels in Chinese, including the title, legend, and category names, with no indication that the skill is region-specific or that users can opt into this locale. The policy explicitly flags language or locale constraints when they are imposed without user choice or justification.
This JSON file contains multiple natural-language labels in Chinese for security dimensions, such as package integrity and credential security, but does not indicate that Chinese is required or provide any user opt-in for locale. Because SQP-3 applies to all file types, this is a language/locale policy concern rather than a code-security issue.
This markdown file is entirely written in Chinese and presents the audit report, findings, and usage guidance in a single fixed language. Under the stated policy, forcing a specific language without user opt-in is a natural-language locale policy violation unless the locale restriction is explicitly justified.