T09 · Insecure Skill Coding Practices
- Location
scripts/build_awesome_readme.py:91- Finding
Unsanitized External Publication Metadata Injected into Generated Markdown
- Content
View full analysis
- Remediation
View remediation
Security audit
Security checks for vulnerabilities and agentic risk
The skill does what it advertises, but it can publish to and change GitHub repositories with insufficient safeguards.
Review before installing. Use it only with an explicit repository owner/name, inspect the generated README before publishing, and avoid running the publish step unless you are comfortable with it creating or updating a GitHub repo and changing visibility through your authenticated gh session.
scripts/build_awesome_readme.py:91Unsanitized External Publication Metadata Injected into Generated Markdown
scripts/publish_repo.py:17Existing Repository Visibility Is Changed Without an Explicit Visibility Request
The skill directs the agent to create or update a repository and push changes, but it does not require a clear user-facing warning or confirmation immediately before performing those external write actions. This is dangerous because it can cause unintended modification of a user's GitHub repository, including creating new repos or overwriting README content, especially when combined with the broad invocation logic and possible default repo selection.
The skill is invoked for a broad 'full pipeline' request and allows missing owner/repo values to fall back to workspace defaults, which can cause the agent to perform repository-affecting actions without a narrowly scoped, explicit user confirmation. In this context, the broad trigger is more dangerous because the pipeline culminates in creating or updating and pushing to GitHub, so accidental invocation can lead to unintended external side effects.
The formatting rules require 'English-only,' which imposes a language constraint regardless of the user's preferences. The file does not offer a language choice or explain a justified locale-specific reason for this restriction.
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
def fetch_crossref(topic: str, limit: int):
q = urllib.parse.quote(topic)
url = f"https://api.crossref.org/works?query={q}&rows={limit}&sort=published&order=desc"
txt = http_get(url)
data = json.loads(txt)
items = data.get("message", {}).get("items", [])
Data is being sent to an external URL. This could be legitimate telemetry or data exfiltration. Manual review is recommended.
def fetch_semantic(topic: str, limit: int):
q = urllib.parse.quote(topic)
fields = "title,abstract,year,venue,url,externalIds,publicationTypes"
url = f"https://api.semanticscholar.org/graph/v1/paper/search?query={q}&limit={limit}&fields={fields}"
txt = http_get(url)
data = json.loads(txt)
out = []
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
def run(cmd, cwd=None):
subprocess.run(cmd, cwd=cwd, check=True)
def main():
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
run(["git", "add", "README.md"], cwd=td)
run(["git", "commit", "-m", "docs: initialize awesome papers README"], cwd=td)
exists = subprocess.run(["gh", "repo", "view", repo], stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL).returncode == 0
if not exists:
run(["gh", "repo", "create", repo, vis_flag, "--source", td, "--remote", "origin", "--push"], cwd=td)
else:
The script can create a GitHub repository, configure a remote, push content, and change repository visibility without any explicit user confirmation or dry-run safeguard. In an agent or automation context, that makes unintended publication or accidental modification of remote resources much more likely, especially because the action targets authenticated GitHub state and may expose data publicly if --visibility public is chosen.
subprocess module calls execute external commands. Without careful input validation, this enables command injection.
if not exists:
run(["gh", "repo", "create", repo, vis_flag, "--source", td, "--remote", "origin", "--push"], cwd=td)
else:
remotes = subprocess.check_output(["git", "remote"], cwd=td).decode()
if "origin" not in remotes:
run(["git", "remote", "add", "origin", f"https://github.com/{repo}.git"], cwd=td)
run(["git", "push", "-u", "origin", "main"], cwd=td)
This code file performs a file write to a user-specified path, which is a safety-relevant operation under the rule. While it prints after completion, there is no prior disclosure, confirmation prompt, or inline comment/docstring warning that the target file will be overwritten if it already exists.
No suspicious patterns detected.