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

Service-to-service security tends to get treated as solved once mTLS is running. It isn't. Privilege escalation in microservices happens in the space between services: a token scoped for one hop gets forwarded three hops deep, an authz service mesh policy checks the route but not the claims inside the request, and a low-privilege service ends up calling operations it was never supposed to reach. Understanding how that chain forms is how you start breaking it.
TLDR:
In a monolithic application, privilege escalation usually follows a recognizable pattern: a user manipulates input to gain access to a resource or action reserved for a higher-privileged role. The trust boundary is clear. The authorization check either exists or it doesn't.
Microservices break that clarity. When a single user request fans out across a dozen services, the question of who is authorized to do what gets distributed across service boundaries, propagated through tokens, and re-checked (or not) at each hop. The result is that privilege escalation stops being a single-point failure and becomes a property of the entire call graph.
In practice, this looks like three distinct failure modes:
Each of these failures is invisible in a single-service code review. The vulnerability lives in the relationship between services, not inside any one of them. Traditional SAST vs DAST approaches were not designed to trace across these boundaries.
In a monolithic application, authorization is a single chokepoint. One service, one auth layer, one set of rules. Microservices broke that model deliberately, distributing logic across dozens or hundreds of independent services that call each other constantly.
Each of those calls is a trust decision. When Service A calls Service B, Service B has to answer a question it often gets wrong: does this caller have the right to do what it's asking?
Several structural properties make this harder than it looks:
The result is a web of implicit trust relationships where a single compromised or misconfigured service can call laterally across the entire mesh with whatever privileges its token carries.
Most microservice deployments follow a pattern that looks secure at first glance: external requests hit a gateway, the gateway validates the JWT, and internal services trust anything that arrives from inside the perimeter. The gateway becomes the single checkpoint, and everything behind it operates on the assumption that auth has already happened. It is a fragile model that cross-domain authentication design must explicitly account for.
The flaw in this model is structural. Services accept requests based on network position, not verified identity. When one service calls another, there is often no check on whether that service has permission to perform that specific action on behalf of that specific user.
An attacker who compromises a low-privilege service gains a foothold that the gateway never sees. From there, calls to upstream services carry whatever identity or claims that compromised service chooses to forward. The perimeter held. The authorization logic inside it did not.
In microservices, privilege escalation takes two forms that behave very differently across service boundaries.
Horizontal escalation happens when a service accesses resources belonging to another identity at the same privilege level. Service A reads Service B's data without authorization. The permissions look correct in isolation; the violation is in scope, not level.
Vertical escalation happens when a service acquires capabilities above its intended privilege level, typically by calling an upstream service that trusts the caller's self-reported role without verification.
Both patterns are common in service mesh environments where implicit trust between internal services replaces explicit authorization checks at each hop.
In a microservices architecture, no single compromised service grants an attacker everything they want. The real damage comes from chaining. A low-privilege service gets a token. That token gets passed to a second service. The second service passes it to a third. At each hop, the authorization check is slightly looser than the last.
This is how privilege escalation in microservices actually works in practice: not a single exploit, but a sequence of small trust assumptions that compound.
Consider a typical three-service call chain: an API gateway that authenticates the user, an order service that processes requests, and a payment service that executes transactions. The gateway validates the JWT and forwards it. The order service checks that the user can place orders, then calls the payment service with the same token. The payment service checks that the token is valid, but by this point, nobody is checking whether this particular user should be calling the payment service directly.
An attacker who compromises the order service can now call the payment service with arbitrary payloads. The token is real. The call looks legitimate. The authz check passes because it was designed to check identity, not call path.
Most service-to-service security controls operate at the perimeter or at individual service boundaries. They answer the question "is this token valid?" but not "should this service be calling that service with these parameters right now?"
The gaps that make chained escalation possible:
The structural problem is that authz in microservices was largely designed around the user-to-service boundary. Service-to-service calls inherited that model without inheriting the same scrutiny.
In microservices, services frequently pass JWTs between each other to propagate caller identity. The assumption baked into most architectures is that if a token arrived from another internal service, it can be trusted. That assumption creates exploitable gaps.
Consider a common pattern: Service A authenticates a user, mints a JWT with role: user, and forwards it to Service B. Service B reads the role claim and gates access. If an attacker can call Service B directly, bypassing Service A entirely, they present whatever claims they want. Service B has no way to verify the token wasn't minted by the attacker if signature validation is absent or misconfigured.
The more subtle case is claim elevation. A token issued with role: user passes through Service A, which appends an internal header like X-Internal-Role: admin before forwarding. Service B trusts that header because it "came from inside." Any service that can reach Service B over the internal network can forge that header.
The failure modes here follow predictable patterns:
alg: none, which carries no cryptographic guarantee. An attacker strips the signature, modifies claims, and resubmits. This class of failure appears in CVE-2025-51471, where cross-domain token exposure produced privilege abuse.aud) claims go unvalidated, so a token issued for Service C is accepted by Service D without question.None of these are exotic misconfigurations. They appear consistently in real service meshes where the JWT validation logic was written once, never reviewed for internal call paths, and quietly inherited by every downstream service.
Detecting privilege escalation across service boundaries requires tracing authorization decisions through the full request chain, starting at the entry point and continuing through every hop. Most observability tooling stops at logging what happened; it does not reason about whether what happened was permitted.
There are three signals worth instrumenting for this class of attack:
Tracing authorization failures across service boundaries is a runtime problem with a code origin. The vulnerable pattern lives in how services propagate context, which means a static pass over a single service's source will not surface it. You need cross-service call chain analysis that follows how identity tokens move from service A to service B, what transformations happen in transit, and whether the receiving service validates the incoming principal independently or inherits trust from the sender.
Gecko's semantic analysis traces these call chains across service boundaries, treating inter-service credential propagation as a first-class data flow problem. Where a conventional SAST tool sees two isolated codebases, Gecko sees a connected authorization graph and can identify the exact code path where a service stops enforcing and starts assuming.
Zero-trust authorization in a service mesh means every inter-service call is authenticated and authorized at the point of receipt, regardless of where the request originated. No service trusts another by default, even if both run inside the same cluster, a principle the OWASP Microservices Security Cheat Sheet lays out in concrete implementation patterns.
Three controls make this work in practice:
Implementing mTLS and sidecar-enforced policies solves the network identity problem. It does not solve the authorization logic problem.
A service can hold a valid certificate, pass every policy check at the mesh layer, and still carry a request that escalates privilege at the application layer. The mesh confirms that Service A is allowed to call Service B's /orders endpoint. It has no visibility into whether the JWT inside that request carries an inflated role claim, whether the user_id in the request body belongs to the authenticated caller, or whether the sequence of calls across three services reconstructs a privilege chain that no single policy was written to block.
This is the structural gap. Mesh-layer authorization operates on network identity and route metadata. Application-layer authorization operates on business logic, claim content, and cross-service state. Neither layer sees what the other sees, and the attack surface lives in the space between them.
Each service in a microservices architecture should carry only the permissions it needs to do its job. In practice, this rule gets violated constantly. Services accumulate roles over time, inherit broad IAM policies from earlier deployment templates, or get granted wildcard scopes because debugging was easier that way. The result is a set of service identities where any single compromised credential opens far more of the system than it should.
For human users, least privilege is about read vs. write access. For service identities, the scope is wider. A service identity governs which other services can be called, which data stores can be queried, which secrets can be read, and which administrative actions can be taken. Getting this wrong in any one dimension creates a path an attacker can walk after gaining a foothold.
Three failure modes appear repeatedly in service identity configuration:
* or all scopes instead of listing the exact permissions the downstream consumer requires, granting far broader access than any individual downstream call needs.aud claim, letting any service with a valid token impersonate a caller to any other service.Defining least privilege is straightforward in theory. Keeping it enforced across dozens of services as teams ship new features is the harder problem. A few controls make a measurable difference:
| Control | What It Enforces | Where It Breaks Down |
|---|---|---|
| Per-service IAM roles | Limits blast radius per workload | Drift as roles accumulate new permissions without removal |
| Short-lived credentials | Reduces exposure window after compromise | Requires rotation infrastructure; secrets often cached longer than intended |
| Audience-restricted tokens | Prevents token reuse across services | Only works if consuming services validate the aud claim consistently |
| Service mesh mTLS + authz policy | Attaches identity to the network layer | Policy gaps at ingress or between mesh and non-mesh workloads |
None of these controls work in isolation. A service mesh that enforces mTLS but issues broad authorization policies still allows lateral movement once one service is compromised. Audience-restricted tokens are meaningless if consuming services skip audience validation under load or during error recovery paths.
The engineering discipline required here is continuous: permissions need to be reviewed when services change scope, when new endpoints are added, and when deployment templates are reused across teams.
Traditional static analysis tools were built for a different era of software architecture. They scan individual services in isolation, tracing data flows within a single codebase, and flag issues based on pattern matching against known vulnerability signatures. That approach worked reasonably well for monolithic applications where authorization logic lived in one place.
Microservices break that assumption entirely.
When a request travels through an API gateway, hits a user service, calls an orders service, and finally reaches a payments service, the authorization decisions made at each hop are distributed across four separate codebases. A static analyzer pointed at the payments service sees only what arrives at its boundary. It has no visibility into whether the caller was properly authenticated upstream, whether the JWT claims were validated correctly in the orders service, or whether the API gateway stripped a privileged header before forwarding the request.
The authorization gap lives between services. No single file contains it. No single scanner finds it.
This is a structural limitation, not an implementation gap. Static analysis tools are designed around the concept of a trust boundary being enforced within the code they can read. In microservice architectures, that trust boundary is a property of the whole system, not any individual service.
Pattern matching against a single service's code will not surface any of these. The vulnerability is in the relationship between services, not the code of any one of them. That structural gap explains how Gecko uncovers cross-service vulnerabilities no single-service scanner finds.
Gecko's approach to this problem starts at the architectural level. Instead of scanning individual services in isolation, Gecko builds a cross-service semantic graph that traces how identity, tokens, and authorization context flow between services throughout a request lifecycle.
When a request enters Service A and gets forwarded to Service B, Gecko follows that call chain. It maps the trust assumptions each service makes, identifies where those assumptions go unverified, and surfaces the exact code paths where a lower-privileged caller can reach a higher-privileged operation.
Most static analysis tools lose track of a request the moment it crosses a network boundary. Gecko holds that context across the entire call chain by reasoning over several layers simultaneously:
Every finding includes the full inter-service call chain, the specific code location where the authorization assumption breaks down, and a proof-of-concept showing how the escalation path is reachable, going further than conventional single-service scanners that stop at the service boundary. Security teams get the exact scope of the problem without reconstructing it manually from logs or service diagrams.
Each service in your mesh is making trust decisions that the services around it cannot see. That distributed blindspot is what makes privilege escalation in microservices so persistent. The fix is not another perimeter control; it is cross-service visibility into how identity and authorization context move through your call chains. Schedule a call with the Gecko team to see how this applies to your architecture.
In a monolith, privilege escalation is a single-point failure: an authorization check either exists or it doesn't. In a microservices architecture, the vulnerability is a property of the entire call graph. A low-privilege service passes a token to a second service, which passes it to a third, and each hop makes a slightly looser authorization assumption than the last. No single file contains the flaw, so no single-service scanner finds it.
The gateway trust trap is the common pattern where a perimeter gateway validates JWTs while every internal service treats traffic that arrived inside the cluster as implicitly authorized. Mutual TLS solves the network identity problem: it confirms that Service A is allowed to call Service B's /orders endpoint, but has no visibility into whether the JWT inside that request carries an inflated role claim or whether the user_id in the request body belongs to the authenticated caller. Mesh-layer authorization operates on route metadata; application-layer authorization operates on business logic and cross-service state, and the attack surface lives in the space between them.
Instrument three signals: requests where a downstream service receives a principal identity not present in the originating HTTP headers; token reuse across service roles, where a credential scoped to one service appears in calls initiated by a different service; and authorization decisions that succeed downstream but would have failed at the gateway. Static analysis of a single service will not surface these patterns. Cross-service call chain analysis is required to follow how identity tokens move between services, what transformations happen in transit, and whether the receiving service validates the incoming principal independently or inherits trust from the sender.
Snyk is built for dependency and supply-chain scanning, a complementary capability to application-layer authorization analysis. It cannot reason about whether authorization logic is correct across service boundaries, and missing authorization checks have no syntactic signature its rules engine can match. Gecko traces the full inter-service call chain, maps where JWT claims are forwarded without re-validation, and identifies the exact code path where a lower-privileged caller can reach a higher-privileged operation. For cross-service privilege escalation, Snyk's architecture has a structural blind spot; it was not designed for that class of problem.
Start with per-service IAM roles to contain blast radius, audience-restricted tokens to prevent reuse across services, and short-lived credentials with automatic rotation to reduce the exposure window after a compromise. The harder problem is drift: review permissions when services change scope, when new endpoints are added, and when deployment templates are reused across teams. None of these controls work in isolation. A service mesh that enforces mTLS but issues broad authorization policies still allows lateral movement once one service is compromised.
Gecko Security
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.