Quick revision
The short answer
I would move access control from individual effort into the platform: deny-by-default and object-level checks built into shared frameworks, shared authorization libraries or a policy engine with a clear model, and automated tests and scanners that try cross-user access on every endpoint. Around that I would train developers with examples from our own incidents, and track findings by team and type over time so that fixes are funded in the roadmap rather than squeezed between features.
What to remember
In this answer, we treated recurring broken access control as a system problem. We classified past findings, moved deny-by-default and object-level checks into a platform starter, gave teams a clear model with shared libraries or a policy engine, automated two-user attack patterns in tests and scanners, trained with our own incidents and measured findings by team and type so that the fixes were funded in the roadmap.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
I would move access control from individual effort into the platform: deny-by-default and object-level checks built into shared frameworks, shared authorization libraries or a policy engine with a clear model, and automated tests and scanners that try cross-user access on every endpoint. Around that I would train developers with examples from our own incidents, and track findings by team and type over time so that fixes are funded in the roadmap rather than squeezed between features.
Why this question is asked
Broken access control has topped industry rankings of web application risks for years, and when it is also the top finding in our own reviews, the cause is rarely that developers do not care. The cause is that every endpoint needs its own correct decision, and the default when someone forgets is usually open. Interviewers ask this leadership question to see whether we attack the system that produces the findings rather than the findings one by one. In this answer, we will analyse why the findings keep coming, make secure behaviour the platform default, give teams a clear authorization model, automate the testing, train with our own stories and set up the measurement and funding that keep it going.
1Why the Same Finding Keeps Coming Back
We start by reading the last two years of findings and classifying them. Typically most fall into a few patterns: missing object-level checks (one user reads another user's data), missing function-level checks (a normal user calls an admin endpoint), tenant isolation gaps, and trusting values from the client, such as a role or a price in the request body. The analysis also shows where the decisions were made: usually in controllers, written by hand, differently by each team.
This tells us the problem is structural. Each finding was fixed, but the next endpoint was written in the same way. Training alone will not change that, because a well-trained developer under deadline still forgets one check in fifty. The programme must change the default.
| Finding type | Typical example | Platform control |
|---|---|---|
| Missing object-level check | GET /invoices/124 shows bob's invoice | Ownership helpers, query filters, two-user tests |
| Missing function-level check | USER calls /admin/export | Deny-by-default chain, required declarations |
| Tenant isolation gap | list returns other tenant's rows | Data-layer tenant filter in the starter |
| Trusting client values | role or tenant id from request body | Principal-derived context object, lint rule |
| Inconsistent rules | same action, different checks | Shared authorization library or policy engine |
2Make Secure Behaviour the Platform Default
The platform team ships a security starter that every service uses. It configures a filter chain ending in denyAll(), enables method security, and fails the build if a controller method has no authorization declaration. It provides a tenant filter at the data layer so queries are scoped automatically, and a context object that exposes the current user and tenant from the token, so nobody parses ids from the request. Teams can still override, but overriding is explicit, visible in code review and listed in a report.
The key idea is that forgetting now produces a failing build or a refused request, not an open endpoint. A team that does nothing special gets safe behaviour.
3Give Teams a Clear Authorization Model
Developers write ad hoc checks when there is no obvious right way. So we publish one: coarse rules in the filter chain, object rules in services through a shared library of annotations and authorization beans, tenant rules in the data layer. For rules shared across many services, such as data classification by region, a policy engine like OPA or Cedar behind a standard Spring AuthorizationManager keeps one version of the truth.
The library should make the right thing short. An annotation such as @OwnedBy("customerId") that checks the loaded object's owner is used; a ten-line pattern copied from a wiki is not. Examples in the library come from our own domains, invoices and orders and accounts, so teams recognise them.
4Automate the Attack Patterns
Broken access control is easy to test once we think like an attacker: use two accounts and swap identifiers. We automate that in three places. In each service, a generated test calls every endpoint with object ids as a second user and as a user without the needed role, expecting 403 or 404. In the pipeline, a dynamic scanner replays recorded API traffic with a different user's session and flags responses that should have been refused. And before release of high-risk features, security engineers run focused tests and turn each finding into a new automated case.
- Finding from test, scan or pentestclassified by type and team
- Fix in the servicewith a regression test
- Could the platform have prevented it?YesAdd a control or library featureNoAdd to training examples
- Roll out to all servicesstarter version, lint or test
- Track the trendfindings per type per quarter
5 steps in order. Play them, or step through them one at a time.
Notice the decision in the middle. Every finding asks whether the platform could have stopped it. Over time, the answer moves categories of bugs out of individual code and into shared controls.
5Train With Our Own Incidents
Generic security training teaches the vocabulary but rarely changes behaviour. What sticks is our own story: this endpoint, in our code, let a customer read 40,000 other customers' statements, this is the request the tester sent, and this is the one-line fix. We run short sessions per team with real anonymised findings from their area, a hands-on exercise where developers attack a deliberately vulnerable copy of one of our services with two accounts, and a review checklist with the five questions that would have caught most past findings.
6Measure, Report and Fund
We track findings by type, team, severity and source (internal test, scanner, pentest, bug bounty, incident) per quarter, plus leading indicators: services on the current security starter, endpoints without declarations, and coverage of two-user tests. A good trend is that findings move left, from pentests and incidents to automated tests in the pipeline, and then decline.
Leadership sees this quarterly, and the remediation work is planned in the roadmap with real capacity, for example a fixed share of each team's time until their open findings are closed, rather than squeezed between features. Without funding, a programme like this becomes a slide; with it, the top finding category changes within two to three years.
7Follow-up questions
How do you get teams to adopt the security starter?
Make it the easiest path: new services get it from the project template, it brings useful defaults beyond security, and migration guides are short. For existing services, we set a deadline per risk tier and report adoption, and the platform team helps the first few teams migrate personally.
Is a bug bounty part of this programme?
It can be, once the basics are in place. A bounty finds what our own tests miss, but if the same class of bug appears every week, we pay for findings our platform should prevent. It works best as a final layer that feeds new test cases.
What metric would you show the board?
One trend line of high-severity access control findings per quarter, split by where they were found, and the percentage of services on the secure defaults. It shows both risk and whether the investment is reaching the code.
8Conclusion
In this answer, we treated recurring broken access control as a system problem. We classified past findings, moved deny-by-default and object-level checks into a platform starter, gave teams a clear model with shared libraries or a policy engine, automated two-user attack patterns in tests and scanners, trained with our own incidents and measured findings by team and type so that the fixes were funded in the roadmap.
Open with
Since it is the top finding year after year, I would treat it as a system problem, not a people problem. First I would classify two years of findings, and usually most are missing object-level checks, missing function-level checks, tenant gaps and trusting client values, written ad hoc in controllers.
Then, if they want more
Then I would change the default through the platform: a security starter with deny-by-default filter chains, method security enabled, a build check that every endpoint declares its authorization, a data-layer tenant filter and a context object for the current user, so forgetting causes a failure rather than an open endpoint.
Second, a clear model with shared libraries, like ownership annotations and authorization beans, and a policy engine behind an AuthorizationManager where rules are shared across many services.
Third, automation of the attacker's pattern: generated tests calling every endpoint as a second user and as an unprivileged user, scanners replaying traffic with other sessions, and every finding turned into a regression test and, where possible, a platform control. Fourth, training using our own anonymised incidents and a hands-on two-account exercise.
Finally, I would track findings by type, team and source each quarter and get remediation capacity into the roadmap, so leadership can see findings moving from pentests into the pipeline and then declining.
About this answer
- Last updated
- 12 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- Spring Security reference
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Broken access control remains the most common finding in your company's security...": https://scrivio-interview-library.netlify.app/spring-boot/authorization/70e0fae02e/