T09 · Insecure Skill Coding Practices
- Location
scripts/bwp.sh:574- Finding
Arbitrary Local File Disclosure Through Absolute Paths and Symlinks
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill is a coherent writing helper, but its generated sharing server can expose local files over the network with weak default credentials.
Review carefully before installing. Use the writing-template commands only in a trusted local project, change the generated credentials immediately, avoid exposing the server outside localhost, do not rely on Basic Auth over plain HTTP, and do not serve sensitive directories until the path-containment issue is fixed.
scripts/bwp.sh:574Arbitrary Local File Disclosure Through Absolute Paths and Symlinks
scripts/bwp.sh:505Public Network Binding with Predictable Default Credentials
scripts/bwp.sh:836Basic Authentication Credentials and Content Are Transmitted Over Plaintext HTTP
scripts/bwp.sh:638Stored HTML and Script Injection in Markdown Preview and Directory Listings
Appending an alias to ~/.bashrc establishes persistent modification of the user's shell environment. Although presented as optional convenience, persistence in shell startup files is security-relevant because it changes future command behavior and can be abused to mask or redirect execution if the referenced script changes later.
�用 bwp:
选项1:直接使用完整路径(推荐,无需修改配置)
/home/claw/.openclaw/workspace/skills/build-with-public-writer/scripts/bwp.sh help
选项2:手动添加 alias(可选)
# 如果你希望使用简短的 bwp 命令,可以手动添加 alias 到 ~/.bashrc
# ⚠️ 注意:这会修改你的 shell 配置文件,请审查后再执行
echo 'alias bwp="/home/claw/.openclaw/workspace/skills/build-with-public-writer/scripts/bwp.sh"' >> ~/.bashrc
source ~/.bashrc
查看帮助:
bwp help
bwp init
输出:
🚀 Initializing Build with Public project...
✅ Directory structure created
✅ README.md created
✅ .env created
✅ server.py created
📁 Project structure:
articles/ - Technical articles and blog posts
courses/ - Course outlines and tutorials
theory/ - Frameworks and methodologies
persona/ - Writing pe
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
✅ Directory structure created
✅ README.md created
✅ .env created
✅ server.py created
📁 Project structure:
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
✅ Directory structure created
✅ README.md created
✅ .env created
✅ server.py created
📁 Project structure:
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
✅ Directory structure created
✅ README.md created
✅ .env created
✅ server.py created
📁 Project structure:
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
✅ Directory structure created
✅ README.md created
✅ .env created
✅ server.py created
📁 Project structure:
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
✅ Directory structure created
✅ README.md created
✅ .env created
✅ server.py created
📁 Project structure:
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
✅ Directory structure created
✅ README.md created
✅ .env created
✅ server.py created
📁 Project structure:
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
✅ Directory structure created
✅ README.md created
✅ .env created
✅ server.py created
📁 Project structure:
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
✅ Directory structure created
✅ README.md created
✅ .env created
✅ server.py created
📁 Project structure:
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
✅ Directory structure created
✅ README.md created
✅ .env created
✅ server.py created
📁 Project structure:
The skill states it auto-generates a .env file containing authentication information and a server supporting Basic Auth. Generating auth material and a reachable service without documented secure defaults, rotation guidance, or secret-handling constraints increases the risk of weak credentials, accidental exposure, or unsafe storage.
**说明**:
- 创建完整的目录结构
- 生成 README.md 说明文档
- 自动生成 .env 配置文件(包含端口、认证信息)
- 自动生成 server.py Web 服务器(支持 Markdown 渲染和 Basic Auth)
- 只需执行一次,或在目录缺失时执行
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
🔗 Shareable Link: http://localhost:12000/articles/2026-03-13-ai-trends-v1.md
👤 Access credentials configured in .env (Check /home/claw/codewithriver/.env for AUTH_USERNAME and AUTH_PASSWORD)
Directing users or an agent to check a file for AUTH_USERNAME and AUTH_PASSWORD can normalize secret-file access inside a skill workflow. In agent environments with file-read capability, this can expand the chance of unintended credential disclosure through logs, summaries, or downstream tool use.
http://localhost:12000/articles/2026-03-13-ai-trends-v1.md
👤 Access credentials configured in .env (Check /home/claw/codewithriver/.env for AUTH_USERNAME and AUTH_PASSWORD)
The example includes AUTH_USERNAME and AUTH_PASSWORD fields in a documented local config schema. While example placeholders are not secrets, normalizing inline auth configuration for a local web server can lead to insecure deployments, especially if users copy weak example values or expose the service beyond localhost.
bwp link 命令会读取 /home/claw/codewithriver/.env 文件中的配置:
# /home/claw/codewithriver/.env
PORT=12000
CUSTOM_DOMAIN=your-domain.com # 可选,用于生成分享链接
AUTH_USERNAME=user
The text says the tool will not display credentials but tells the user to check the .env file directly. In an agent context, that still creates a pathway for secret access because the agent may have local file-read capability and could surface those values inadvertently.
- `CUSTOM_DOMAIN`: 设置后,`bwp link` 会生成 `http://your-domain.com:PORT/...` 的链接
- 未设置时,默认使用 `localhost`
- **注意**: 出于安全考虑,`bwp link` 不会显示实际的凭证值,请直接查看 .env 文件
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
echo "✅ README.md created"
# Create .env file
cat > "$PROJECT_ROOT/.env" << 'ENVEOF'
# Build with Public - Environment Configuration
# Server port
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
echo "✅ README.md created"
# Create .env file
cat > "$PROJECT_ROOT/.env" << 'ENVEOF'
# Build with Public - Environment Configuration
# Server port
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
echo "✅ README.md created"
# Create .env file
cat > "$PROJECT_ROOT/.env" << 'ENVEOF'
# Build with Public - Environment Configuration
# Server port
The generated server code initializes default credentials (user / changeme), which is dangerous because users may start the service without changing them. In a content-sharing server, predictable default authentication can allow unauthorized access to all hosted project files if the server is exposed beyond localhost.
CONFIG = {'PORT': 12000, 'AUTH_USERNAME': 'user', 'AUTH_PASSWORD': 'changeme'}
if os.path.exists('.env'):
with open('.env', 'r') as f:
for line in f:
line = line.strip()
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
CONFIG = {'PORT': 12000, 'AUTH_USERNAME': 'user', 'AUTH_PASSWORD': 'changeme'}
if os.path.exists('.env'):
with open('.env', 'r') as f:
for line in f:
line = line.strip()
if line and not line.startswith('#') and '=' in line:
The skill documents shell execution, file access, and local web serving behavior but declares no explicit tool scope or allowed-tools boundary. In an agent setting, this increases the chance that the skill can invoke broader capabilities than a reviewer or user expects, weakening least-privilege controls.
Skill establishes unauthorized persistence across sessions via cron jobs, startup scripts, or state files. Session persistence allows an attacker to maintain access beyond the current interaction.
---
name: build-with-public-writer
description: Use "bwp" command to create technical content for codewithriver. Supports articles, courses, theory, persona with version management and link sharing
---
# Build with Public (bwp) - 技术内容创作系统
The skill instructions and operational descriptions are written predominantly in Chinese, with no indication that users may choose another language or locale. This creates a language/locale policy concern because the skill appears to assume a specific language experience rather than offering opt-in or alternatives.
This shell script contains natural-language comments in Chinese and also generates a README whose visible instructional content is largely Chinese-only. The file does not offer users any language or locale choice, which can violate a language/locale policy when a skill implicitly forces one language without opt-in.
The init flow creates and configures a Python HTTP server plus a credential file, which expands the skill from local content scaffolding into network-exposed content hosting. That added attack surface is significant because users invoking a writer helper may not expect it to provision and encourage running a server that can expose project files over the network.
No suspicious patterns detected.