T09 · Insecure Skill Coding Practices
- Location
scripts/extract_mbti_pdfs.py:4- Finding
Absolute Local Path and Developer Identity Disclosure
- Content
View full analysis
Vulnerability Details
File Location:
scripts/extract_mbti_pdfs.py, lines 4-5 and 20
Vulnerability Type: Local filesystem metadata disclosure through hard-coded paths and generated artifacts
Risk Level: LowVulnerable Code
python src = Path(r"D:\SOFTWARE\AppData\Desktop\MBTI") out = Path(r"C:\Users\fuetsui\.openclaw\workspace\skills\my-mbti\references")python content = f"# {code}\n\nSource PDF: `{pdf}`\n\nOriginal title: {title}\n\n{body}\n"Technical Analysis
The script hard-codes workstation-specific absolute paths, including the developer username
fuetsuiand the local OpenClaw workspace layout. This information is directly exposed to anyone who receives the source package.In addition, the script inserts the complete source PDF path into every generated Markdown file. Because
pdfis obtained from recursive traversal of the absolute source directory, its string representation can include usernames, private directory names, document organization, and other local filesystem metadata.The second disclosure occurs when generated Markdown files are committed, published, uploaded, or otherwise shared. No network transmission or unauthorized file access is implemented by the script itself.
Attack Path
- An attacker obtains the distributed Skill package and inspects
scripts/extract_mbti_pdfs.py. - The hard-coded output path immediately reveals a developer username and local workspace structure.
- A maintainer runs the extraction script against a local PDF collection.
- The script writes each absolute source PDF path into the corresponding generated Markdown file.
- The generated files are committed or shared without metadata review.
- The attacker inspects the
Source PDFfields to identify local usernames, directory structures, document names, or organizational information.
Impact Assessment
The issue exposes local identity and filesystem metadata. It may reveal:
- The developer username.
- Loc ...[truncated 413 chars]
- An attacker obtains the distributed Skill package and inspects
- Remediation
View remediation
Remediation Suggestions
- Replace hard-coded paths with explicit command-line parameters:
python import argparse from pathlib import Path parser = argparse.ArgumentParser() parser.add_argument("source", type=Path) parser.add_argument("output", type=Path) args = parser.parse_args() src = args.source.resolve() out = args.output.resolve()- Do not include absolute source paths in generated files. Record only a non-sensitive filename when provenance is required:
python content = ( f"# {code}\n\n" f"Source PDF: `{pdf.name}`\n\n" f"Original title: {title}\n\n" f"{body}\n" )-
Consider omitting the source field entirely if it is not needed at runtime.
-
Add a publication check that rejects generated artifacts containing Windows drive paths, home-directory paths, usernames, or other absolute paths.
-
Keep environment-specific configuration outside the distributed Skill package, such as in ignored local configuration files or command-line arguments.
-
Regenerate and review all reference files after applying the fix to ensure no historical local path metadata remains.
