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
An AFO was found in SuperAGI’s file upload functionality due to insufficient sanitization of user-supplied filenames. The implementation checks file extensions, but it fails to neutralize directory traversal sequences such as ../, allowing attackers to write files outside the intended directory.
The vulnerability lies in the /api/resources/add/<agent_id> endpoint in the superagi/controllers/resources.py file. The file path is constructed using os.path.join() with a base directory and user-provided filename, without enforcing path constraints. Although extensions are validated, an attacker can append a valid extension (e.g., .pdf) to a malicious filename like ../../../etc/passwd%00.pdf to bypass checks.
The file is written using Python’s open() in binary write mode (‘wb’), which allows overwriting existing files. The base directory is retrieved from ResourceHelper.get_root_input_dir, which does not enforce path containment, making arbitrary overwrite possible anywhere within the app’s writeable file system.
upload() in superagi/controllers/resources.py get_root_input_dir() in superagi/helper/resource_helper.py open() in superagi/controllers/resources.py To verify this vulnerability, we need to
<code class="hljs language-bash"><span class="hljs-comment"># create a malicious file</span>
<span class="hljs-built_in">touch</span> anyfile.txt
<span class="hljs-built_in">echo</span> <span class="hljs-string">"This is a test file"</span> > anyfile.txt
<span class="hljs-comment"># create the resource with said file as a parameter</span>
curl -X POST <span class="hljs-string">"http://127.0.0.1:3000/api/resources/add/1"</span> \
-H <span class="hljs-string">"Content-Type: multipart/form-data"</span> \
-F <span class="hljs-string">"file=@anyfile.txt"</span> \
-F <span class="hljs-string">"name=../../../../etc/passwd.txt"</span> \
-F <span class="hljs-string">"type=text/plain"</span> \
-F <span class="hljs-string">"size=1024"</span>
</code><code class="hljs language-bash">{
<span class="hljs-string">"name"</span>: <span class="hljs-string">"../../../../etc/passwd.txt"</span>,
<span class="hljs-string">"path"</span>: <span class="hljs-string">"/app/workspace/input/test_1/anyfile.txt"</span>,
...
}
</code>This vulnerability allows attackers to:

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.