T09 · Insecure Skill Coding Practices
- Location
scripts/get_category.py:23- Finding
Unbounded HTTP Request and Response Handling
- Content
View full analysis
Vulnerability Details
File Location:
scripts/get_category.py, lines 23–26
Vulnerability Type: Missing network timeout and response-size limit
Risk Level: LowVulnerable Code
python response = requests.get(url, params=params) response.raise_for_status() result = response.json()Technical Analysis
The HTTP request does not define connection or read timeouts. Consequently, the process can remain blocked indefinitely if the remote server accepts the connection but responds very slowly or never completes its response.
The response is also loaded and decoded as JSON without enforcing a maximum body size. A compromised, malicious, or malfunctioning endpoint could return an excessively large response and cause substantial memory consumption. Although HTTP request errors are handled elsewhere in the function, the implementation does not validate response size or fully validate the decoded response structure before processing it.
Attack Path
- An attacker compromises the configured
skills.myzaker.comservice or gains an equivalent ability to influence its responses. - The skill sends its normal category-news request to the configured endpoint.
- The attacker either keeps the response open without completing it or sends an excessively large JSON body.
- Because no timeout or response-size boundary is configured, the process remains blocked or consumes excessive memory.
- The skill invocation becomes unavailable and, under severe memory pressure, the hosting process may terminate.
Impact Assessment
The issue affects availability of the skill and potentially the process hosting it. Successful exploitation may cause an indefinitely stalled invocation, resource exhaustion, or process termination.
The flaw does not grant additional system privileges, provide access to credentials, or directly enable arbitrary code execution. Exploitation depends on control of, or interference w ...[truncated 59 chars]
- An attacker compromises the configured
- Remediation
View remediation
Remediation Suggestions
-
Configure explicit connection and read timeouts, for example:
python response = requests.get( url, params=params, timeout=(5, 15), stream=True, ) -
Read the response incrementally and reject it once a reasonable maximum size is exceeded.
-
Check
Content-Typebefore attempting JSON decoding. -
Catch response-decoding and schema-validation failures and return a controlled error.
-
Validate that
resultis an object,stathas the expected type,datais an object, andlistis an array before iterating over articles. -
Consider bounded retries with exponential backoff for transient failures; retries must retain strict per-request and overall time limits.
-
