How Agentic SAST Decodes Business Context to Hunt Privilege Escalation

Sylvia Xu (Product Security Engineer · TikTok), Songjiu Liu (Security Engineer · TikTok)

[un]prompted.au 2026 · Day 1 · Main Hall

Overview

In a rapidly evolving digital landscape, ensuring robust authorization controls remains a paramount challenge for security teams. This talk, presented by Sylvia Xu and Songjiu Liu from TikTok, introduces AuthMatrix, an innovative agentic SAST (Static Application Security Testing) tool designed to specifically address the complex problem of privilege escalation. AuthMatrix distinguishes itself by leveraging the power of Large Language Models (LLMs) to decode the nuanced "business context" embedded within an application's codebase, thereby enabling a more intelligent and accurate identification of authorization flaws.

Watch on YouTube

Visual summary for How Agentic SAST Decodes Business Context to Hunt Privilege Escalation by Sylvia Xu, Songjiu Liu
Visual summary for How Agentic SAST Decodes Business Context to Hunt Privilege Escalation by Sylvia Xu, Songjiu Liu

Key moments

  1. 0:00 Introduction to AuthMatrix and privilege escalation problem
  2. 3:50 Core idea: comparing frontend vs. backend authorization
  3. 5:20 Why LLMs? Semantic judgment for role checks
  4. 7:00 AuthMatrix architecture and workflow orchestration
  5. 8:05 Mitigating LLM non-determinism and context overflow
  6. 11:45 AuthMatrix results and impact on security workflow
  7. 15:50 Audience Q&A: LLM costs and token usage

How Agentic SAST Decodes Business Context to Hunt Privilege Escalation

Speakers: Sylvia Xu (Product Security Engineer, TikTok); Songjiu Liu (Security Engineer, TikTok)

Conference: [un]prompted.au

YouTube: https://www.youtube.com/watch?v=FkAmaEEgHxA

Overview

In a rapidly evolving digital landscape, ensuring robust authorization controls remains a paramount challenge for security teams. This talk, presented by Sylvia Xu and Songjiu Liu from TikTok, introduces AuthMatrix, an innovative agentic SAST (Static Application Security Testing) tool designed to specifically address the complex problem of privilege escalation. AuthMatrix distinguishes itself by leveraging the power of Large Language Models (LLMs) to decode the nuanced "business context" embedded within an application's codebase, thereby enabling a more intelligent and accurate identification of authorization flaws.

The core premise of AuthMatrix tackles a fundamental disconnect: the often-divergent authorization logic implemented on the frontend versus the backend of a web application. Traditional security testing methods, whether blackbox penetration testing or conventional SAST tools, frequently fall short in comprehensively assessing this disparity. Sylvia Xu illustrates this with a relatable analogy: a restaurant where a "secret menu" item is intended only for managers, but the kitchen, lacking proper identity checks, will prepare it for anyone who places the order. This mirrors how an application might expose sensitive functionality to unauthorized users due to mismatched role-based access controls.

AuthMatrix aims to bridge this gap by systematically comparing frontend and backend authorization rules. By understanding the "business intent" often expressed in the user interface and contrasting it with the server-side enforcement, the tool can precisely pinpoint privilege escalation vulnerabilities that would otherwise require extensive manual review or remain undiscovered. The talk details the architectural innovations and strategic use of LLMs, coupled with deterministic code logic, that make AuthMatrix an effective solution for hunting these critical security issues at scale within large, complex codebases like TikTok's.

Background

▶ Watch: Introduction to AuthMatrix and privilege escalation problem (0:00)

The challenge of identifying privilege escalation vulnerabilities in modern web applications is multifaceted and resource-intensive. Sylvia Xu highlights two traditional approaches and their inherent limitations.

Blackbox Penetration Testing: As a former security consultant, Xu recounts the common practice of requesting multiple testing accounts—one for each user role—to send requests to every discovered endpoint. For an application with 10 user roles and 400 endpoints, this translates to reviewing 4,000 individual requests. This process is "very time-consuming" (02:00) and often leads to an overwhelming volume of results that require extensive manual analysis to differentiate legitimate behavior from actual vulnerabilities. The lack of code visibility further complicates the assessment, making it difficult to understand the underlying authorization logic.

Traditional SAST Tools: While providing access to the codebase, conventional SAST tools often struggle with the semantic understanding required for sophisticated authorization checks. They are adept at pattern matching but fall short when distinguishing between a genuine role-based access control (RBAC) check and other unrelated code logic, such as a sandbox bypass mechanism (06:00). For instance, identifying if role is admin is straightforward, but understanding the intent behind it and comparing it across different layers of an application proves challenging without semantic awareness. This often results in a high volume of false positives or a failure to detect nuanced authorization bypasses.

The core problem, as identified by the speakers, is the difficulty in determining if an application's implementation matches its intended business logic. Developers are frequently asked to clarify whether specific user roles are truly meant to consume certain endpoints (02:00). This manual verification process is not scalable and introduces friction into the development lifecycle.

AuthMatrix proposes a novel solution: the business intent for authorization is often "hiding in the frontend codebase" (02:00). When a user, lacking the necessary privileges, attempts to access a restricted page, they might encounter a "forbidden error page" or see "greyed out button[s]" (02:00). These UI elements explicitly communicate the expected user roles. By systematically comparing these frontend-documented roles with the actual authorization checks implemented on the backend, security teams can construct a comprehensive matrix to pinpoint discrepancies.

Xu provides illustrative examples (04:00):

  • Export Report Endpoint: The frontend might indicate that only a "moderator" can export reports. However, the backend might have no checks, allowing "any login user, any authenticated user" to perform this action. This is a clear privilege escalation vulnerability.
  • Payout Approve Endpoint: The frontend might specify that an "admin" needs to "verify your email first" before approving payouts. The backend, conversely, might allow "any admin without verifying email" to approve payouts. While more granular, this still represents a bypass of a stated security control, qualifying as a privilege escalation.
  • Safe Endpoint: If the backend implements stricter checks than the frontend, the endpoint is deemed safe. For example, the frontend might say "admin," but the backend requires "super admin."

The vision is that "once this matrix exist, the bug is almost arithmetic" (04:00)—a straightforward comparison reveals the vulnerabilities. The innovation lies in using LLMs to enable this semantic comparison at scale, while carefully mitigating the inherent weaknesses of these powerful, yet imperfect, AI models.

Key Findings

▶ Watch: Why LLMs? Semantic judgment for role checks (5:20)

The development and deployment of AuthMatrix yielded significant improvements in the efficiency and accuracy of privilege escalation vulnerability detection at TikTok. The results presented by Sylvia Xu demonstrate a substantial leap over traditional methods.

In an initial assessment, AuthMatrix reviewed a considerable volume of code, analyzing 476 endpoints (12:00). Out of these, the tool intelligently flagged a manageable subset of 45 endpoints for human review (12:00). This indicates a highly effective filtering process, as AuthMatrix was able to "clear about 91% of noise" (12:00), allowing security engineers to focus their efforts on the most promising leads rather than sifting through thousands of irrelevant findings.

Of the flagged endpoints, a remarkable 80% true positive rate was achieved for confirmed vulnerabilities (12:00). The remaining 20% were not necessarily false positives but rather findings that were difficult to confirm due to challenges in obtaining specific testing accounts or satisfying complex, edge-case API trigger conditions (12:00). This high true positive rate underscores the tool's precision in identifying genuine security flaws.

A crucial component of AuthMatrix's success is its knowledge base, which stores human-validated business context. The implementation of this knowledge base led to a significant improvement in the tool's precision, boosting it from an initial 50% to 77% (12:00). This demonstrates the power of combining LLM-driven analysis with targeted human-in-the-loop feedback, allowing the system to learn and refine its understanding of ambiguous authorization rules over time.

Beyond these specific metrics, AuthMatrix fundamentally transformed the security team's workflow:

  • Reduced Friction with Developers: The need to constantly "ask RD [developers] from please give us some testing account" has been virtually eliminated. Instead, security engineers now request "the full repo" for scanning, engaging developers only "whenever it is needed" for clarification (13:00).
  • Efficient Triage: The volume of findings requiring human triage has dramatically shrunk "from hundreds to handfuls" (13:00), freeing up valuable security engineer time.
  • Comprehensive Coverage: AuthMatrix provides "certain coverage no matter it's 200 endpoints or 2000 endpoints or how big the codebase it is" (13:00). This ensures consistent security posture across projects of varying scales.
  • Defensible Findings: By saving "the artifact saved in the each step," the tool generates detailed evidence for its findings, allowing security teams to "always go back to check whether we doing well" and defend their conclusions (13:00).

These findings collectively highlight AuthMatrix as a powerful, scalable solution that not only enhances the accuracy of privilege escalation detection but also significantly streamlines the security testing process within a large enterprise environment.

Technical Deep Dive

▶ Watch: AuthMatrix architecture and workflow orchestration (7:00)

AuthMatrix is built upon an intricate architecture that strategically harnesses the strengths of LLMs while meticulously mitigating their inherent weaknesses. The core concept is an agentic SAST approach, where specialized agents perform discrete tasks within a broader workflow.

Leveraging LLM Strengths: Semantic Judgment

The primary advantage of LLMs in this context is their ability for semantic judgment (06:00). Unlike traditional SAST tools that rely on pattern matching, LLMs can "understand the meaning of the code" (06:00). This is critical for authorization checks. For example, an LLM can differentiate between if role is admin (a genuine identity check) and a piece of code related to a "sandbox bypass" (which is irrelevant for privilege escalation hunting) (06:00). This semantic understanding allows AuthMatrix to accurately identify authorization logic, a task that has historically been difficult for automated tools.

Addressing LLM Weaknesses

The speakers acknowledge three major drawbacks of LLMs (06:00):

  1. Variance: Non-deterministic output, where the "same prompt twice" can yield "two answers, two formats" (06:00).
  2. Context Overflow: LLMs have limited context windows, leading to crashes or poor performance when asked to process "400 files" (06:00).
  3. Hallucination: LLMs can "hallucinate when the user role is ambiguous" (06:00), generating plausible but incorrect information.

AuthMatrix implements robust mechanisms to counteract each of these weaknesses:

1. Orchestration and Handling Variance:

The entire workflow is orchestrated by a deterministic Python workflow (07:00), acting as a reliable backbone. The process is divided into five main, independent steps (07:00):

  • Enumeration: Identifying all endpoints and reconnoitering the authorization framework.
  • Backend Access Control: Analyzing server-side authorization logic.
  • Frontend Access Control: Extracting authorization intent from client-side code.
  • Mapping: Comparing frontend and backend findings.
  • Reconciliation: Finalizing the vulnerability assessment.

Crucially, each step is independent, allowing for modularity and re-execution. Outputs from one step feed into the next as "fresh context" (07:00). To combat LLM variance, a validator is added after each LLM call (08:00). This validator performs two key checks:

  • Format Safety: Ensures the LLM's response adheres to expected formats (e.g., "valid CSV file or whether a valid JSON file"). Malformed responses are "reject[ed]" (08:00).
  • Evidence Checking: The validator examines the LLM's output for internal contradictions. If "any contradiction," the response is also rejected (08:00).

Rejected responses trigger a retry loop (08:00). Importantly, "all the feedback collected" from failed attempts is provided to the LLM in the next retry, allowing it to "know the mistake they made" and improve its subsequent response (08:00). This control mechanism significantly reduces false positives and prevents "broken files from flowing to the next step" (09:00), leading to higher accuracy.

2. Handling Context Overflow:

To avoid overwhelming the LLM, AuthMatrix adopts a strategy of task decomposition based on endpoints (09:00). Instead of feeding the entire codebase to a single agent, the system divides the task such that "each endpoint, it will be assigned to one sub-agent" (09:00). Depending on the LLM's context window, one sub-agent might handle "multiple three or four" endpoints (10:00). This approach ensures that "each endpoint will be reviewed in the equal attention" (10:00), and performance "will not drop whether the codebase is very, very big" (10:00), guaranteeing a consistent true positive rate.

3. Handling Hallucination:

The solution to LLM hallucination centers on providing "concrete answer[s] before it hallucinate[s]" (10:00) through a human-in-the-loop approach. When faced with ambiguous user roles (e.g., discerning if "super admin" is equivalent to "admin"), the system triggers a manual review (10:00). The "actual app owner or the RD, the developer, or the user who actually using the application" (10:00) provides the definitive answer. This crucial context is then stored in a knowledge base (11:00). In subsequent assessments, the LLM can access this stored knowledge, preventing it from hallucinating on previously clarified ambiguities (11:00). This mechanism allows the system to learn and improve its understanding of an application's specific business logic over time.

Overall, AuthMatrix's architecture involves decomposing tasks "horizontally, vertically" across five major steps and numerous sub-agents (12:00). This systematic approach ensures thoroughness, resilience against LLM limitations, and continuous improvement through feedback loops and a growing knowledge base.

Demo / Proof of Concept

▶ Watch: AuthMatrix results and impact on security workflow (11:45)

While the talk does not feature a live, interactive demonstration of the AuthMatrix tool in action, the entire presentation serves as a comprehensive proof of concept for its innovative approach to privilege escalation detection. The speakers effectively demonstrate the utility and efficacy of AuthMatrix through concrete examples, a detailed architectural overview, and compelling performance metrics derived from its internal deployment at TikTok.

The initial conceptual examples presented in the "Background" section (04:00) illustrate the types of vulnerabilities AuthMatrix is designed to find:

  • Export Report Endpoint: This scenario highlights a common flaw where the frontend restricts access to "moderator" roles, but the backend lacks any authorization checks, allowing "any authenticated user" to export sensitive data. AuthMatrix's comparison logic would flag this as a critical discrepancy.
  • Payout Approve Endpoint: This example delves into more granular authorization bypasses, where the frontend requires an "admin" to "verify your email first," but the backend permits "any admin" to approve payouts without this additional verification step. This demonstrates the tool's ability to identify subtle deviations from stated business intent.

These examples, though hypothetical, clearly articulate the mechanism by which AuthMatrix identifies privilege escalation. The "Demo / Proof of Concept" is further substantiated by the key findings discussed earlier, which represent the real-world results of AuthMatrix operating on TikTok's codebase (12:00). Reviewing 476 endpoints, flagging 45 for human review, achieving an 80% true positive rate, and clearing 91% of noise are not theoretical claims but validated outcomes. The improvement in precision from 50% to 77% due to the knowledge base further underscores the system's practical effectiveness (12:00).

The technical deep dive into how LLM weaknesses (variance, context overflow, hallucination) are mitigated through deterministic workflows, validators, sub-agents, and a human-in-the-loop knowledge base (07:00-11:00) also functions as a "proof of concept" for the robustness of their agentic design. It shows that an LLM-powered security tool can be engineered to be reliable and accurate in a production environment, despite the inherent challenges of LLM behavior.

In essence, the talk provides ample evidence that the AuthMatrix concept is not merely theoretical but a functional, impactful solution. The reported metrics and the detailed account of its architecture serve as a strong testament to its capabilities as a novel agentic SAST tool for hunting privilege escalation.

Defensive Implications

▶ Watch: Audience Q&A: LLM costs and token usage (15:50)

The insights and methodology presented by Sylvia Xu and Songjiu Liu offer several critical defensive implications for security practitioners and organizations looking to enhance their authorization security posture:

  1. Prioritize Frontend Codebase Analysis for Business Intent: Defenders should no longer view the frontend solely for XSS or third-party library vulnerabilities. The talk strongly advocates for analyzing the frontend codebase, as it often contains the clearest expression of business intent regarding user roles and permissions (14:00). LLMs, as demonstrated by AuthMatrix, can be instrumental in extracting this intent, providing a crucial baseline for comparison with backend enforcement.
  1. Integrate LLMs with Deterministic Code Logic for Robust Tools: The presentation highlights the synergy between non-deterministic LLM judgment and deterministic code logic (14:00). LLMs excel at semantic understanding, while traditional code provides reliable orchestration and validation. Security teams should explore building custom tools that leverage LLMs for complex, semantic tasks (like interpreting authorization rules) and deterministic code for verification, workflow management, and ensuring output reliability. This hybrid approach mitigates LLM weaknesses while harnessing their strengths.
  1. Decompose Security Tasks into Small, Verifiable Steps: The AuthMatrix architecture emphasizes decomposing complex tasks into granular, independent steps that are "small enough to verify" (14:00). This principle is vital for debugging and evaluating agentic systems. When developing security automation, breaking down the process (e.g., endpoint enumeration, frontend analysis, backend analysis, mapping) allows for easier identification of failures, provides clearer audit trails, and facilitates performance tuning.
  1. Establish a Knowledge Base with Human-in-the-Loop Feedback: For scenarios involving ambiguous business context or user role definitions, a human-in-the-loop mechanism to feed concrete answers into a knowledge base is invaluable (15:00). This "ask human once, remember forever" approach ensures that LLM-powered tools learn and improve their understanding over time, reducing hallucination and increasing precision. Defenders should identify such ambiguous areas in their own applications and systematically build a context-aware knowledge base.
  1. Shift from Manual Account Provisioning to Repository-Based Scanning: The success of AuthMatrix demonstrates a paradigm shift from the laborious process of requesting multiple testing accounts for blackbox testing. Instead, security teams can now request "the full repo" for comprehensive, automated scanning (13:00). This significantly reduces friction with development teams and enables broader, more consistent coverage across the entire application portfolio.
  1. Implement Continuous, Artifact-Driven Security Assessments: AuthMatrix's ability to "rerun the whole workflow" for new features and changes (16:00) and save "artifacts saved in the each step" (13:00) underscores the importance of continuous security assessment. Defenders should aim for automated pipelines that can be triggered frequently, generate defensible findings with clear evidence, and adapt to the rapid pace of software development. This ensures that security posture is maintained as applications evolve.

By adopting these defensive strategies, organizations can move towards a more proactive, scalable, and intelligent approach to identifying and mitigating privilege escalation vulnerabilities, ultimately enhancing their overall security resilience.

Key Takeaways

  • Look to the Frontend for Business Intent: The frontend codebase is a rich, often overlooked source of business intent regarding authorization. Leveraging LLMs to analyze UI logic can provide a critical baseline for identifying discrepancies with backend enforcement, uncovering privilege escalation vulnerabilities.
  • Harmonize LLMs with Deterministic Code: Combine the semantic understanding of non-deterministic LLMs with the reliability of deterministic code logic. LLMs can interpret complex meaning, while traditional code can orchestrate workflows, validate outputs, and ensure system stability, creating a powerful and accurate security tool.
  • Decompose Tasks for Verifiability and Debugging: Break down complex security assessment tasks into small, independent, and verifiable steps. This modular approach simplifies debugging, allows for easier performance evaluation, and ensures higher accuracy in agentic systems.
  • Build a Persistent Knowledge Base with Human Input: For ambiguous business contexts or role definitions, incorporate a human-in-the-loop mechanism to feed concrete answers into a persistent knowledge base. This allows agentic tools to learn, reduce hallucination, and improve their precision over time without repeated manual intervention.
  • Embrace Agentic SAST for Scalable Privilege Escalation Hunting: Agentic SAST tools, like AuthMatrix, can drastically improve the efficiency and coverage of privilege escalation detection. By automating the comparison of frontend intent and backend implementation, these tools can scale to large codebases, significantly reduce manual triage efforts, and provide continuous security assurance.

About the Speaker(s)

Sylvia Xu (Yanqing) is a Product Security Engineer at TikTok. With a background as a security consultant for approximately four years prior to joining TikTok, she brings a practical, hands-on perspective to product security challenges. Sylvia is one of the key contributors to the AuthMatrix project, an internal tool designed to hunt for privilege escalation issues.

Songjiu Liu is a Security Engineer at TikTok and a collaborator on the AuthMatrix project. While the transcript provides less detail about Songjiu, his involvement as a security engineer at TikTok and a collaborator on this innovative project underscores his expertise in developing advanced security solutions. His LinkedIn profile (https://www.linkedin.com/in/songjiuliu) is provided for further information.

Reviews

Dr. Zero (Offensive Security Researcher) — SOLID

When most people say 'AI-powered SAST', they mean piping a repo into GPT-4 and praying it doesn't hallucinate. Xu and Liu actually built a clever mechanism to diff frontend UI states against backend API enforcement to hunt privilege escalation. It's a surprisingly elegant way to use LLMs for semantic analysis instead of magic bug finding.

Heather Calloway (CISO) — SOLID

TikTok's AppSec team built an LLM-driven SAST workflow that actually solves a high-friction business problem: mapping frontend business intent against backend authorization enforcement. It cuts vulnerability noise by 91% and gets security engineers out of the business of begging developers for test accounts. This is a highly practical blueprint for scaling application security.

→ Top-rated talks at [un]prompted.au 2026

All talks from [un]prompted.au 2026