T09 · Insecure Skill Coding Practices
- Location
scripts/web_mockup_job.py:153- Finding
Server-Side Request Forgery Through Unrestricted Image URL Fetching
- Content
View full analysis
Vulnerability Details
File Location:
scripts/web_mockup_job.py:153-155
Vulnerability Type: Server-Side Request Forgery (SSRF)
Risk Level: MediumVulnerable code:
python elif source.get("url"): import requests # Public CDN/vendor URL — do not send the Odoo credential elsewhere. resp = requests.get(source["url"], timeout=HTTP_TIMEOUT)Technical Analysis
The web mockup workflow accepts image source URLs returned by the remote Odoo planning service and passes them directly to
requests.get(). It does not validate:- The URL scheme
- The destination hostname
- Resolved IP address ranges
- Redirect destinations
- Whether the destination is loopback, link-local, private, reserved, or otherwise non-public
requests.get()follows redirects by default. Consequently, even a URL initially pointing to an approved public image host can redirect the agent host to an internal destination.The comment correctly notes that the Odoo authorization header is not attached to this separate request. This prevents direct disclosure of the Odoo token but does not prevent SSRF from the agent host.
Attack Path
- An attacker controls or influences an art or blank image URL returned in a
web_mockup_planresponse, or controls an external image endpoint used by that response. - The workflow reaches
Odoo.download()while processing the affected source. - The attacker supplies a direct internal URL or returns an HTTP redirect to a destination such as a loopback, link-local, or private-network service.
requests.get()connects to that destination using the network privileges of the agent host.- The workflow checks only the status and broad
Content-Typeconditions before writing the response to disk. - If the response contains image-compatible data, it may be incorporated into a mockup and uploaded to Odoo through the workflow’s normal upload path.
Impact Assessment
...[truncated 580 chars]
- Remediation
View remediation
Remediation Suggestions
- Permit only the
httpsscheme for externally supplied image URLs. - Maintain an allowlist of approved vendor and CDN hostnames where operationally practical.
- Resolve the destination hostname before connecting and reject loopback, link-local, private, multicast, reserved, and other non-global address ranges for both IPv4 and IPv6.
- Disable automatic redirects with
allow_redirects=False, or manually follow redirects while applying the complete URL and resolved-address validation policy to every hop. - Revalidate the connected peer address to reduce DNS-rebinding and time-of-check/time-of-use risks.
- Apply strict response size limits and image decoding validation before persisting response data.
- Route external image retrieval through a dedicated egress proxy that enforces destination restrictions.
- Add regression tests covering direct private addresses, IPv6 local addresses, alternate numeric IP representations, DNS rebinding scenarios, and public URLs redirecting to internal services.
- Permit only the
