When I approach a new web application, my instinct as a penetration tester is pretty predictable:
Where can I break it?
Can I inject something?
Can I access another user's data?
Can I manipulate authentication?
Can I find sensitive information in logs?
Those are useful questions. But during a recent AppSec Academy exercise, I realized I was asking them too early.
Before asking how an application can be broken, I need to understand how the application is supposed to work.
That sounds obvious.
It wasn't.
The Scenario
The exercise started with almost nothing:
AcmeNotes is a SaaS note-taking platform for small businesses. Organizations invite users to collaborate on notebooks. Users can upload attachments, share notes internally, and generate AI summaries of meeting notes.
No source code.
No Burp Suite.
No documentation.
The assignment wasn't to find vulnerabilities. It was to build an initial model of the application by identifying:
- Assets
- Actors
- Trust boundaries
- Components
- Assumptions
This is much closer to what happens during an architecture review or at the beginning of an application security assessment. You frequently don't know exactly how the system works yet.
You have to build a model, document your assumptions, and then verify them.
Start With What the Business Actually Cares About
My first task was identifying assets.
One useful shift was avoiding the temptation to immediately list technical infrastructure such as servers and databases.
Those systems matter, but they're containers for what the organization actually values.
For AcmeNotes, the important assets could include:
- Customer data
- Uploaded files
- Internal notes
- AI-generated meeting summaries
- Employee information
- Project information
- Release timelines
- Architecture and design information
- Organization membership and permissions
This changes the security conversation.
Instead of asking:
How do I attack the database?
I can ask:
What confidential business information does this application process, and through which systems can that information travel?
That second question gives me far more places to investigate.
Actors Are Not the Same as Attackers
This was one of the first places my mental model needed correction.
When asked to identify actors, I immediately included things like:
- Hacktivists
- Nation-state actors
- Competitors
- Insider threats
Those are threat actors.
But before thinking about adversaries, I needed to identify the system actors: the people and systems that legitimately interact with the application.
For a SaaS application like AcmeNotes, those might include:
- Anonymous visitors
- Authenticated users
- Organization members
- Organization administrators
- Support administrators
- Internal employees
- Contractors
- Identity providers
- AI providers
- Email providers
- Storage providers
- Background workers
That distinction matters because threat modeling starts with understanding intended behavior.
Before asking how an attacker could abuse an administrator function, I first need to understand what an administrator is actually supposed to be able to do.
I Had Oversimplified AuthN/AuthZ
The biggest realization from this lab was that I had mentally compressed a large portion of application security into one convenient bucket:
AuthN/AuthZ
In reality, a request may involve several independent decisions.
| Security decision | Question |
|---|---|
| Identity establishment | Who are you? |
| Identity propagation | How does the application know who you are throughout the request? |
| Session validation | Are you still authenticated? |
| Authorization | Are you allowed to perform this action? |
| Tenant isolation | Are you operating within the correct organization? |
| Resource ownership | Does this object belong to you? |
| Business rules | Is this operation valid in the application's current state? |
| Persistence | Should this change actually be saved? |
| Auditing | Can we determine what happened later? |
Consider something seemingly simple:
Delete Note
My pentester brain might initially ask:
Can I manipulate the note ID and delete somebody else's note?
That's a perfectly valid test.
But the security engineering question comes first:
What security decisions must succeed before a note is deleted?
The application might need to determine:
- Who submitted the request?
- Is the session valid?
- Is that user authorized to delete notes?
- Does the note belong to the user's organization?
- Does the user own the note or otherwise have permission to modify it?
- Is the note in a state where deletion is allowed?
- Does organizational policy permit deletion?
- Should the operation be recorded in an audit log?
- Should the deletion be permanent, soft-deleted, or recoverable?
Now I have significantly more security controls to investigate.
More importantly, I understand why they exist.
Trust Boundaries Aren't Just Network Hops
My original trust-boundary model included relationships such as:
browser → backend
backend → AI
backend → storage
AI → browser
storage → browser
browser → storage
There was a problem.
I was drawing arrows without first establishing whether those systems actually communicated directly.
Does the browser really communicate directly with object storage?
Maybe.
Perhaps the application generates signed URLs and the browser uploads directly to an S3-compatible service.
Or perhaps every upload passes through the application server.
I don't know yet.
And that's exactly the point.
Don't assume. Verify.
A better initial model might look something like:
Browser
│
▼
Application
│
┌────────────┼────────────┐
│ │ │
▼ ▼ ▼
Database Object Storage AI Service
│
└───────────────┐
▼
Audit Logs
Application
│
▼
Email Service
This isn't a declaration that AcmeNotes definitely works this way.
It's a hypothesis about the architecture that can be validated later.
The arrows are especially interesting because each relationship generates security questions.
Application → Database
- Was the request authorized before the query occurred?
- Is tenant isolation enforced?
- Can user-controlled input influence the query?
- Can data belonging to another organization be returned?
Application → Object Storage
- How are uploaded objects identified?
- Are object identifiers predictable?
- Can one tenant request another tenant's files?
- Are signed URLs used?
- How long do those URLs remain valid?
Application → AI Provider
- What customer information leaves the application's trust domain?
- Is tenant data isolated before constructing AI requests?
- Can prompt injection influence downstream behavior?
- Is sensitive information unnecessarily sent to the model?
- What happens to prompts and responses after processing?
Application → Email Provider
- Can users trigger arbitrary email?
- Can invitation functionality be abused?
- Can password reset behavior enumerate accounts?
- Could confidential information be sent to an unauthorized recipient?
- Are email-triggering functions rate limited?
Application → Logging
- Are sensitive operations recorded?
- Can logs be modified?
- Are credentials, tokens, or confidential data accidentally logged?
- Can logs themselves become a source of cross-tenant information disclosure?
Suddenly, architecture isn't just boxes and arrows.
Every arrow represents assumptions about trust.
Those assumptions are where interesting security questions begin.
Architecture, Data Flow, and Request Processing Aren't the Same Diagram
Another mistake I made was trying to represent everything in one diagram.
There are really several different questions.
Architecture Diagram
What systems exist?
Browser
Application
Database
Object Storage
AI Provider
Email Provider
Identity Provider
Logging
Data Flow Diagram
Where does information move?
Browser → Application
Application → Database
Application → Object Storage
Application → AI
Application → Email
This is where trust boundaries become particularly important.
Sequence Diagram
What happens during a specific operation?
For example:
Request received
↓
Identity established
↓
Session validated
↓
Authorization checked
↓
Tenant validated
↓
Resource ownership checked
↓
Business rules evaluated
↓
Database operation
↓
Audit event generated
↓
Response returned
Not every request follows that exact sequence.
That's another thing to verify.
But separating these diagrams prevents infrastructure, application logic, and data movement from becoming one giant conceptual blob.
Assumptions Are Not Attack Hypotheses
I also initially wrote things like:
Can I use AI chat to gain unauthorized access to confidential information?
and:
Can I use the browser for some kind of injection attack?
Those are good questions.
But they aren't assumptions.
They're attack hypotheses.
An assumption would be:
Organizations are isolated using a tenant identifier.
The attack hypothesis becomes:
Can I manipulate an object identifier to access another tenant's notes?
Another assumption:
Authorization is enforced server-side.
Attack hypothesis:
Can I call an API endpoint directly and bypass a restriction enforced by the UI?
Another assumption:
AI summaries only receive data the current user is authorized to access.
Attack hypothesis:
Can I manipulate the AI functionality into retrieving or exposing information belonging to another user or department?
The distinction is useful:
Assumptions help me understand the system.
Attack hypotheses help me test it.
And the second becomes much stronger when it comes from the first.
Don't Forget Business Processes
Technical architecture is only part of the application.
For AcmeNotes, I also need to understand workflows such as:
- How are users invited?
- Who owns a notebook?
- Can notebook ownership change?
- Who can share notes?
- Can users share information outside their organization?
- What happens when an employee leaves?
- Who can delete a notebook?
- Can deleted information be recovered?
- How are organizations created?
- Can organizations merge?
- How are administrators assigned?
- How does billing affect account state?
None of those questions requires SQL injection, XSS, or an RCE.
But failures in those workflows can produce serious vulnerabilities.
A perfectly secure SQL query doesn't help if the application happily lets Employee A invite an external account into Company B's confidential notebook.
The Pentester Instinct Isn't Wrong
The interesting part of this exercise wasn't discovering that my offensive instincts were bad.
They weren't.
When I saw a multi-tenant SaaS platform with AI functionality, one of my immediate questions was whether the AI functionality could expose confidential information across departments or customers.
That's exactly the kind of thing I should eventually test.
The problem was when I was asking the question.
Instead of beginning with:
Can I exploit this?
I'm learning to begin with:
How is this supposed to work?
Then:
What assumptions must be true for it to remain secure?
And finally:
How can I prove those assumptions wrong?
That sequence produces much more deliberate testing.
A Simple Habit for New Applications
Two questions provide a surprisingly good starting point when examining an unfamiliar application.
Who can send data into this system?
Examples:
- Anonymous users
- Authenticated users
- Administrators
- APIs
- Webhooks
- Identity providers
- Internal employees
- AI services
Who receives data from this system?
Examples:
- Browsers
- Databases
- Object storage
- AI providers
- Email providers
- Logging platforms
- Analytics services
- Payment processors
Answering those two questions begins revealing the application's actors, components, data flows, and trust relationships before I ever send a malicious request.
From Vulnerability Hunting to Security Engineering
My biggest takeaway from this exercise wasn't a new vulnerability class.
It was realizing how much of the request pipeline I'd mentally hidden behind the words authentication and authorization.
A real application makes many smaller security decisions.
And security failures often happen because one of those decisions is missing, inconsistent, performed in the wrong place, or based on an incorrect assumption.
So the workflow I'm taking into future assessments is:
Understand the application
↓
Identify the assets
↓
Identify the actors
↓
Map the components
↓
Map the data flows
↓
Identify trust boundaries
↓
Document assumptions
↓
Understand business processes
↓
Develop attack hypotheses
↓
Test
That's a different mindset from opening Burp and immediately looking for something vulnerable.
Burp still comes out.
Just a little later.
Senior Insight
Before looking for vulnerabilities, build an accurate model of the system.
If the mental model is wrong, testing will be guided by incorrect assumptions.
The quality of an application security assessment isn't determined only by how many exploitation techniques you know. It's also constrained by how accurately you understand the system you're trying to assess: that's the real lesson to learn.
And it's one I'm going to carry into the next assessment.