T09 · Insecure Skill Coding Practices
- Location
SKILL.md:109- Finding
Unvalidated OAuth Token Endpoint Allows Signed JWT Disclosure and Server-Side Request Forgery
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill has a legitimate SEO reporting purpose, but it handles Google service-account credentials and writes local artifacts with weaker scoping than users should accept without review.
Review before installing. Use only a Google-generated service-account key with restricted Search Console access, prefer code that pins the OAuth token endpoint to Google's official URL, install dependencies from reviewed pinned versions, and change the script to use a private per-run working directory and a user-selected output directory.
SKILL.md:109Unvalidated OAuth Token Endpoint Allows Signed JWT Disclosure and Server-Side Request Forgery
SKILL.md:42Unpinned Third-Party Dependencies Create a Supply-Chain Execution Risk
gen_report.py:43Predictable Shared Temporary Paths Permit Local File and Symlink Substitution
Code accesses credential files (SSH keys, AWS credentials, etc.). This could indicate credential theft attempts.
"""Query Search Console Search Analytics API.
Args:
token: OAuth2 access token
site_url: Full property URL, e.g. "https://www.example.com/"
dimensions: List of dimensions. Valid values:
- "date" — daily breakdown
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
"dimensions": dimensions, "rowLimit": row_limit, } resp = requests.post(url, headers={"Authorization": f"Bearer {token}"}, json=body) resp.raise_for_status() return resp.json().get("rows", [])
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.
| `jwt.encode` error | Missing `cryptography` package | `pip install cryptography` |
| PDF shows garbled Chinese | Wrong font | Use TTFont with STHeiti, NOT UnicodeCIDFont with STSong-Light |
| Matplotlib timeout on first run | Building font cache | Set bash timeout to 180000ms; this only happens once |
| `MPLCONFIGDIR` warning | No write access to `~/.matplotlib` | Harmless; matplotlib creates a temp cache automatically |
## Example Usage
The natural-language comments prescribe a mandatory font choice for CJK/Korean support and explicitly forbid an alternative ('NEVER use STHeiti alone'). This hard-codes a locale/language presentation decision rather than offering a user choice, which matches the policy category for forced language or locale behavior.
The code creates a temporary chart directory and later saves multiple PNG files and a PDF report, but only prints progress messages such as 'Generating charts' and 'PDF saved' after the fact. There is no prior disclosure in comments, docstring, or confirmation that the skill will write files to /tmp and a user-specific reports directory.
No suspicious patterns detected.