T09 · Insecure Skill Coding Practices
- Location
scripts/add_abstracts.py:52- Finding
Untrusted Abstract Injection Through Plaintext arXiv Transport
- Content
View full analysis
str: """Clean abstract text for BibTeX""" # Remove excessive whitespace text = re.sub(r'\s+', ' ', text).strip() # Remove or escape problematic characters (minimal) text = text.replace('\n', ' ') text = text.replace('\r', ' ') # Escape curly braces that aren't already escaped # text = text.replace('{', '\\{').replace('}', '\\}') return text ``` ```python if abstract: clean_abs = clean_abstract(abstract) lines.append(f" abstract={{{clean_abs}}},") ``` ### Technical Analysis Because the arXiv request is made over plaintext HTTP, it lacks transport confidentiality and server authentication. An attacker able to intercept or modify network traffic can replace the API response with forged XML. The script performs only a lenient title check and accepts the supplied summary as the abstract. `clean_abstract()` normalizes whitespace but does not safely encode BibTeX syntax, braces, or LaTeX control sequences. Brace escaping is explicitly commented out. Consequently, a forged abstract can terminate or restructure the generated field or introduce attacker-controlled LaTeX content. The Python script itself does not ex ...[truncated 1755 chars]- Remediation
View remediation
