T09 · Insecure Skill Coding Practices
- Location
generate_brief.py:483- Finding
Untrusted Telegram Content Is Parsed as ReportLab Markup
- Content
View full analysis
10: # Dividir en bullets si hay saltos de línea o puntos lineas = [l.strip() for l in contexto_mercado.split("\n") if l.strip()] if len(lineas) == 1: # Párrafo único story.append(Paragraph(contexto_mercado.strip(), s["cuerpo"])) else: story.append(Paragraph( "A continuación se sintetizan los elementos de contexto reportados " "y su implicación para el perfil de riesgo institucional:", s["cuerpo"] )) for linea in lineas: story.append(Paragraph(f"▸ {linea}", s["bullet"])) ``` ### Technical Analysis The market context originates from a Telegram message and is passed directly to ReportLab's `Paragraph` parser. `Paragraph` does not treat its input as plain text; it interprets supported XML-like markup. Because the application does not escape or validate the supplied content, an attacker can submit markup containing supported resource-bearing elements, such as image references. Depending on the installed ReportLab version and resource handler behavior, this can make the server attempt to resolve an attacker-selected URL or local resource during PDF generation. Malformed or excessively complex markup can also trigger parser exceptions or consume generation resources, resulting in denial of service for individual requests. The bot has no user allowlist, so any Telegram user able to reach it can attempt this attack. ### Attack Path 1. An attacker discovers or obtains access to the Telegram bot. 2. The attacker starts the workflow with `/brief`. 3. The attacker submits at least one valid indicator. 4. For the market context, the attacker supplies crafted ReportLab markup containing a ...[truncated 1118 chars]- Remediation
View remediation
