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

API contracts are the closest thing to a map of your system's trust boundaries, but most security tooling treats them as documentation artifacts instead of inputs. Every field in an OpenAPI schema is a potential injection point, every RPC method in a proto file is a potential unauthenticated call, and every AsyncAPI channel is a message boundary where authorization checks go missing. Parsing them correctly is where OpenAPI security analysis actually begins.
TLDR:
security: [] empty array and missing operation-level overrides leave endpoints unauthenticated even when global schemes look correctAPI contracts define what your services promise to each other: which endpoints exist, what data they accept, which fields are required, and how authentication works. When those promises are machine-readable, they become the single source of truth for how a system behaves at its boundaries.
The security implications follow directly. Every field in an OpenAPI schema is a potential injection point. Every authentication scheme declared in a protobuf service definition is a trust assumption that can be violated. Every event channel in an AsyncAPI spec is a message boundary where malformed payloads can propagate through downstream consumers.
Security analysis that ignores these contracts misses where the actual attack surface lives: not inside individual functions, but at the edges where services accept input from the world.
OpenAPI security schemes fall into four main categories, each with distinct attack surfaces that automated analysis must account for.
| Scheme Type | Mechanism | Common Weaknesses |
|---|---|---|
| API Key | Token passed in header, query, or cookie | Leaked keys, no expiry, overly broad scope |
| HTTP (Basic/Bearer) | Credentials or JWT in Authorization header | Weak token validation, missing signature checks |
| OAuth 2.0 | Token flows with scopes and grants | Confused deputy, scope escalation, PKCE bypass |
| OpenID Connect | Identity layer over OAuth 2.0 | Issuer mismatches, nonce replay, claim injection |
Parsing the securitySchemes block in an OpenAPI spec gives a security tool a map of every authentication method an API accepts. What it cannot show, without additional analysis, is whether the implementation matches the declaration. An endpoint marked with bearerFormat: JWT may accept unsigned tokens in practice. An OAuth flow defined as authorizationCode may skip PKCE validation entirely in the server code.
The spec is a contract, not a guarantee. Three gaps appear consistently across real-world OpenAPI security analysis:
security references at the operation level override global scheme declarations, leaving individual endpoints unprotected even when the top-level securitySchemes object looks correct.Effective OpenAPI security analysis cross-references scheme declarations against implementation behavior, beyond the spec in isolation, a distinction central to the SAST vs DAST debate.
OpenAPI's security scheme declarations are where authentication intent lives in a spec, and they are also where automated analysis tends to stall. A spec can declare a securityScheme at the component level and then either apply it globally or override it per operation. Scanners that only read individual endpoint definitions miss this layering entirely.
The three core scheme types each carry distinct risks:
http schemes (Basic, Bearer, Digest) expose credentials in headers that proxies and logs frequently capture, making rotation policy and transport enforcement worth checking explicitly.apiKey schemes placed in query parameters instead of headers are logged by virtually every load balancer and CDN, leaking credentials into access logs.oauth2 and openIdConnect schemes require scope validation at the operation level; a spec that declares broad scopes but never restricts them per endpoint hands attackers lateral movement after a single token compromise.The subtler problem is the empty security array. OpenAPI allows an operation to declare security: [], which explicitly opts that endpoint out of every scheme, including any global default. Parsers that skip absent fields will misread this as "no override specified" when the spec author meant "no authentication required." These two states produce identical scanner output but opposite security posture.
Catching this requires resolving the full security inheritance chain: global declaration, path-level override, operation-level override, and the presence or absence of an explicit empty array at each level. Any tool that does not walk all four layers will produce findings that do not reflect what the API actually enforces at runtime.
Across OpenAPI specifications, the same misconfigurations appear repeatedly in production APIs. Understanding where these failures occur helps identify what a security analysis tool needs to check.
| Misconfiguration | What It Looks Like | Security Risk |
|---|---|---|
| Missing or incomplete security schemes | Global bearerAuth declared but no per-operation security field on sensitive endpoints | Endpoints silently inherit a permissive default or go unenforced at the spec layer |
| Overly permissive scopes | Granular scopes like transactions:read defined in spec; all operations wired to a catch-all scope in code | Spec passes validation; authorization model does not hold at runtime |
| Insecure server definitions | servers array includes an http entry alongside https | Consumers and generated clients treat plaintext transport as acceptable |
| Schema permissiveness | Request body uses additionalProperties: true or omits type constraints | Backend receives payloads it never anticipated, opening injection and mass assignment paths |
OpenAPI lets you declare securitySchemes at the component level and apply them globally or per-operation. When teams skip the per-operation override, endpoints that should require no authentication silently inherit a permissive default, or vice versa. A spec that declares bearerAuth globally but omits the security field on a password-reset endpoint leaves that operation unenforced at the spec layer, meaning downstream gateway or middleware assumptions carry the full burden.
OAuth2 scope definitions in OpenAPI are often aspirational. Teams define granular scopes like transactions:read and transactions:write in the spec, then wire every operation to a catch-all scope at the implementation level. The spec passes validation; the authorization model does not hold.
The servers array accepts both http and https schemes. Specs that list an unencrypted server entry, even as a development convenience, signal to consumers that plaintext transport is acceptable. Automated tooling that parses these specs for client generation will reproduce that assumption.
When request body schemas rely on additionalProperties: true or omit type constraints entirely, parsers accept payloads that backend code never anticipated. That gap between what the spec allows and what the implementation expects is where SQL injection and mass assignment vulnerabilities take hold.
Protobuf's binary encoding eliminates the text-based attack surface that plagues REST APIs, but it introduces a different category of risks that API scanning automated security testing tools frequently miss.
Unlike JSON, Protobuf does not enforce field presence or type constraints at the transport layer by default. A service that skips explicit validation logic will silently accept malformed messages. Fields marked optional in proto3 always have a default zero value, so a missing authentication token field and an explicitly empty one are indistinguishable without application-level checks.
Protobuf parsing is not immune to abuse:
gRPC services commonly skip authentication enforcement between internal services under the assumption that network position implies trust, a pattern that shows exactly why business logic is AppSec's unsolved problem. When a schema exposes an RPC method without server-side AuthN checks, any caller that reaches the port can invoke it. Protobuf security analysis requires tracing which RPC methods enforce authentication and authorization independently of how the service is deployed.
| Risk Category | Root Cause | Detection Requirement |
|---|---|---|
| Missing field validation | proto3 default-value semantics | Schema and handler analysis |
| Unknown field injection | Proto3 unknown field retention | Cross-layer message tracing |
| Unbounded repeated fields | No cardinality constraints in schema | Schema parsing with size limits |
| Missing AuthN on RPC methods | Implicit internal trust assumption | Call graph analysis per method |
AsyncAPI defines event-driven interfaces the same way OpenAPI defines REST ones, but the security implications arrive through a different attack surface. Instead of HTTP endpoints, you're dealing with message channels, brokers like Kafka or RabbitMQ, and async publish/subscribe flows where authorization checks are easy to miss because there's no synchronous request-response cycle enforcing them.
The schema gives you channel names, message payloads, and binding metadata. What it doesn't encode is whether subscribers validate message origin, whether producers authenticate before publishing, or whether a given channel is accessible to any connected client.
Three failure modes appear consistently in event-driven systems:
Catching these requires cross-referencing the AsyncAPI document against broker configuration, consumer implementation, and the trust model between services, work that automated pentest tools and practices must account for. The AsyncAPI server security model documents what the spec can express at the broker level, and what it leaves to deployment configuration. The spec is the starting point, not the answer.
Parsing an API contract for security purposes is different from parsing it for client generation or documentation. The goal is to reconstruct the security posture the spec author intended, then compare that against what the code actually enforces.
| Dimension | OpenAPI | Protobuf (gRPC) | AsyncAPI |
|---|---|---|---|
| Contract type | HTTP REST endpoints | RPC methods and binary message types | Event channels and message schemas |
| Auth expression | Security schemes with global and per-operation overrides | No native auth syntax; enforced via interceptors in code | Server-level security bindings; producer auth not expressible |
| Schema enforcement | JSON Schema types and constraints; not enforced at transport | Binary encoding; proto3 default values mask missing fields | Message payload schemas; broker does not validate by default |
| Key risk area | Missing operation-level security references; overly broad OAuth scopes | Missing AuthN on RPC methods; unbounded repeated fields | Unauthenticated publish access; missing replay protection |
| What analysis requires | Full security inheritance chain across global, path, and operation levels | Per-method call graph traced against handler implementations | Cross-reference against broker config and consumer implementation |
From an OpenAPI document, security-focused parsing extracts:
securitySchemes component block and which operations reference it, including absent references that leave endpoints unprotectedhttp vs. https) and base path scopeProtobuf parsing produces a different inventory. Service and method definitions map to RPC endpoints; message type definitions expose field types, cardinality constraints, and whether authentication-bearing fields are marked required or optional. The proto file itself cannot encode whether a given RPC enforces AuthN, but parsing service definitions across a codebase builds a call graph that static code analysis can trace against handler implementations.
AsyncAPI parsing extracts channel names, message payload schemas, and binding metadata describing broker-specific configuration like Kafka topic partitions or AMQP exchange types. It also maps which application components act as publishers versus subscribers on each channel, giving analysis a producer/consumer graph that can be checked against authorization controls.
The spec gives you the skeleton of intended security behavior. The skeleton tells you where to look for missing muscle.
The combined output of parsing all three formats is an application-level security inventory: every entry point, every declared auth mechanism, and every data boundary. Before a single line of implementation code is read, that inventory already points to the highest-risk surfaces.
Spec parsing gives you a precise picture of what developers intended to build. Code analysis tells you what they actually built. The gap between those two things is where vulnerabilities live, and it is precisely why static analysis struggles with business logic.
The pattern holds across all three formats:
OAuth2 on every endpoint cannot prevent a route handler with a leading special character in its name from bypassing authorization middleware entirely, a gap especially relevant when securing AI-generated code. The spec captures intent; the runtime does whatever the code does..proto file defines message fields and types, but it cannot prevent an unauthenticated caller from reaching an RPC if the server interceptor is absent or misconfigured.Spec parsing surfaces the intended security model. Code analysis verifies whether that model holds. Both inputs are needed to reach a finding worth acting on.
Gecko Security catches a category of vulnerabilities that code-only analysis misses by parsing OpenAPI, Protobuf, and AsyncAPI specifications as first-class security inputs alongside source code, not as documentation artifacts: undocumented endpoints with no access control, schema mismatches that allow type confusion, and message handlers that accept inputs the spec never anticipated.
The table below shows three representative spec-vs-implementation divergences Gecko surfaces during analysis:
| What the Spec Declares | What the Code Does | Finding Type |
|---|---|---|
| bearerAuth required on all /admin/* routes | Route registered under /_admin/users bypasses the auth middleware pattern entirely | Unauthenticated endpoint (undocumented path) |
| Request body field typed as integer in OpenAPI schema | Handler casts the value with String(req.body.id) before passing to a SQL query | Schema mismatch that allows type confusion and injection |
| AsyncAPI channel declares no security binding on the publish operation | Consumer processes messages without validating producer identity or checking a signature field | Missing origin validation on event handler |
The contract defines the intended behavior: which endpoints exist, what authentication is required, which fields are required versus optional, and what data types are expected. Source code defines the actual behavior. When those two diverge, that divergence is a finding worth investigating.
OpenAPI, Protobuf, and AsyncAPI specs each carry a different class of risk, but they share one thing: the gap between what they declare and what the code enforces is where vulnerabilities live. Treating those contracts as first-class security inputs, not afterthoughts, gets you closer to finding what matters. Book a session with the Gecko team if you want to see how that analysis works against your own contracts.
Each format maps to a distinct set of trust boundaries. OpenAPI exposes HTTP endpoint inventory, authentication scheme declarations, and scope assignments; the primary risks are missing operation-level security references and unenforced OAuth scopes. Protobuf exposes RPC method definitions and message field constraints; proto3's default-value semantics mean a missing authentication token and an explicitly empty one are indistinguishable without application-level checks. AsyncAPI exposes message channels and producer/consumer relationships; unauthenticated publish access and missing replay protection are invisible to spec-level analysis alone.
An operation declaring security: [] explicitly opts that endpoint out of every authentication scheme, including any global default, yet parsers that skip absent fields read this identically to "no override specified." The two states produce the same scanner output but opposite security posture. Resolving it requires walking the full four-layer inheritance chain: global declaration, path-level override, operation-level override, and the explicit presence or absence of an empty array at each level.
Treat network position as a deployment assumption, not a security control. Parse service definitions to build a per-method call graph, then trace which RPC methods enforce AuthN and AuthZ independently of how the service is deployed. Any method reachable from an internal caller that reaches the port is unauthenticated regardless of where it sits in the mesh. Proto3's unknown field retention compounds this: clients can inject unrecognized fields that a proxy or middleware layer interprets differently than the receiving service, creating a cross-layer channel that schema analysis alone cannot see.
OpenAPI analysis leaves gaps in runtime enforcement: a spec can declare OAuth2 on every endpoint while a route handler with a leading special character in its name bypasses authorization middleware entirely. AsyncAPI analysis leaves gaps in broker-level authorization: channel accessibility, wildcard subscription scope, and replay protection all live in deployment configuration and consumer implementation, not in the spec document. Both formats share the same core limitation: the spec captures intended behavior, and verification requires cross-referencing that intent against what the code and infrastructure actually enforce.
Yes. Gecko ingests OpenAPI specs, Protobuf schemas, and AsyncAPI definitions as security context alongside source code, building a single semantic inventory that maps every entry point, declared authentication mechanism, and data boundary across all three formats. Where a vulnerability chain spans a REST endpoint defined in OpenAPI, an internal gRPC call defined in Protobuf, and an event published to a channel defined in AsyncAPI, Gecko traces the full path, catching the class of flaws where authorization is checked at one boundary but not enforced downstream.
Jeevan Jutla
Co-founder & CEO
JJ joined GCHQ as a teenager, working on security research and exploit development, and scored the highest mark on its reverse engineering and binary exploitation aptitude test ever recorded. The record still stands. He went on to lead security tool development for Binance’s eight-person red team and led the recovery of $500K stolen by North Korean state hackers, the largest recovery of stolen funds at the time.
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
See what actually changed in the OWASP Top 10 for 2026, from merged SSRF and XXE categories to new supply chain risks and scanner coverage gaps.
Jeevan Jutla
Gecko Security uncovered CVE-2026-21894 in August 2026, an n8n authorization bypass with CVSS 8.8. See why static tools missed it and how to remediate it.
Jeevan Jutla
Security misconfiguration is OWASP A05 for a reason. Learn how deployment context determines exploitability and how to fix gaps in August 2026.
Jeevan Jutla
How do modern AppSec vendors actually compare? This July 2026 capability map covers SAST, DAST, SCA, business logic flaws, and cross-service
Gecko Security
Break down your AppSec stack: what SAST, DAST, SCA, IAST, and pen testing each see — and what they miss. Updated July 2026 by Gecko Security.
Gecko Security
Occasional updates, new content, and insights. No spam; unsubscribe anytime.