Di Balik Layar Penetration Testing: Membedah Celah Infrastruktur dan Logika Otorisasi
The API for insurance policy inquiry validated the authentication token but did not check whether the token's owner was authorised to view the requested policy number. By changing a sequential policy number, an attacker could access other people's personal and financial policy data.
Published on medium.com
Pengujian keamanan aplikasi sering kali dibayangkan sebagai sebuah proses peretasan dramatis yang menembus pertahanan sistem terdalam. Kenyataannya, proses ini adalah analisis sistematis yang mempertemukan metodologi teknis dengan pemahaman terhadap logika bisnis sebuah perangkat lunak.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Context
This write-up looks at an internal security report from NemoSecurity covering testing carried out for PT Panin Dai-ichi Life. Two digital assets were in scope, and they behave very differently.
The first is the Panindai Academy platform, a Learning Management System (LMS). Testing concentrated on two of its modules, Agency (AGE) and Bancassurance (BAN). The second is an API Inquiry Polis, which is integrated with Salesforce and serves insurance policy data. Its workflow looks conventional: a caller requests an authentication token, then presents that token together with a policy number (policyNo) to pull the policy record from the system.
The contrast between the two assets is the point of the report. The LMS produced configuration hygiene findings of low severity. The API produced an object-level authorisation flaw scored 6.5 under CVSS 3.1, and was then rejected by the client on business grounds.
Setup
Two testing methods were combined across the engagement:
- Black box. The tester sits outside with no access at all. This was used early to map the attack surface and to find information that had been exposed to the public by accident.
- Grey box. The tester is given limited access, in this case an official user account and an administrator account, so that features behind the login (dashboards, user management) can be evaluated.
The combination matters because it tests both the front door and the internal partitions behind it.
Tools named in the report:
| Phase | Tool |
|---|---|
| Reconnaissance | httpx, WhatWeb |
| Automated scanning | Nuclei, Xray |
| Manual API manipulation | Burp Suite, Postman |
Finding it
The LMS: infrastructure hygiene
Reconnaissance with httpx and WhatWeb identified the platform as a Laravel application running on Nginx on Ubuntu. Automated scanning with Nuclei and Xray did not surface large-scale critical vulnerabilities such as SQL injection or lethal Cross-Site Scripting. What the scans did highlight was configuration hygiene:
- Configuration files such as
.htaccessand.DS_Storecould be accessed directly by the public, which leaks hints about the internal directory structure of the application. - A number of standard security headers, including CSP and HSTS, were not implemented.
- Session cookies were not equipped with the full set of protective flags.
All of these were classified as Low or Informational severity. The report's reasoning is that a suboptimal configuration does not always give an attacker a direct way in, but it does indicate that the release standard for the system is not strict. The analogy used is a building with an unlocked window on an upper floor: hard to reach directly, but dangerous if the attacker finds a staircase through some other flaw.
The API: a parameter that was trusted too much
The API Inquiry Polis was tested manually with Burp Suite and Postman. The tester manipulated parameters and identified an Insecure Direct Object Reference (IDOR), which in modern API terminology is described as Broken Object Level Authorization (BOLA).
The problem is in how the server validates a request. It confirms that the token presented is valid, but it does not check whether the owner of that token is entitled to view the policy number being requested. Because policyNo is sequential, keeping the same token and simply changing the value is enough to reach another person's policy data.
Exploitation
Step 1: obtain a token
The caller requests an authentication token from the API. The report describes this step but does not reproduce the request, so the exact endpoint, method and body are not available here.
Step 2: request a policy with the token
The token is presented together with a policyNo to retrieve the policy record. Again the report describes the flow without reproducing the raw request.
Step 3: change only the policy number
With the same token retained, the tester changed the value of policyNo. Because the numbers are sequential, a neighbouring value belongs to a different policyholder. The tester could access another person's policy data, which shows the token's validity was checked but its authorisation over that specific object was not.
The report does not include the literal request or response for this step.
Root cause
The server performs authentication but not object-level authorisation. It verifies that the token is valid, and stops there. It never asks whether the identity behind the token is allowed to see the requested policyNo. The sequential nature of the policy numbers makes the missing check very susceptible to mass exploitation.
Existing defences did not stop it because the only control in the path was token validity. The report does not describe any additional ownership check, rate limiting or response filtering that would have interfered.
Impact
The exposed data includes personal information such as name and date of birth, and financial data such as policy status and premium amount. Because policy numbers are sequential, the flaw is very susceptible to mass exploitation. The finding was scored 6.5 under the CVSS 3.1 matrix.
The report is careful about the conditions. In theory, and by global security standards, a user being able to reach a third party's data without authorisation is a fatal flaw. The client clarified, however, that at present the application is designed to hold a single user role only. Under that architecture, the ability to view every policy number is considered by design rather than a vulnerability. On that operational argument the high-risk finding was formally rejected as something requiring immediate remediation.
The report keeps the strategic caveat: if the application later grows and adopts a multi-user role structure, this design becomes technical debt that is very dangerous if it is not mitigated early.
Fix
No fix was applied. The finding was rejected by the client on the single-role argument above, so the report records no code change, configuration change or retest.
The report warns that if multi-user roles are introduced, this design becomes technical debt that is very dangerous if not mitigated early.
Variants to test
- Sequential object identifiers on any token-protected endpoint. Take a valid token, request your own object, then change the identifier to a neighbouring value. A positive result is another party's record being returned.
- Identifier formats other than plain integers. A positive result is the same cross-account data return through any of those channels.
- Role assumptions that are only documented, not enforced. Where a product claims a single-role design, check whether the API itself enforces that assumption or merely relies on there being one role today. A positive result is an endpoint that returns data for an object the caller does not own, which will become exploitable the day a second role is added.
- Exposed configuration and metadata files. Request
/.htaccess,/.DS_Storeand similar paths directly. A positive result is a readable file that discloses directory structure or other internal hints. - Missing security headers and cookie flags. Inspect responses for CSP, HSTS and the full set of cookie protective attributes. A positive result is their absence, which is low severity on its own but raises the value of any other flaw found.
Closing observation
The two halves of this engagement show a pattern worth keeping. Automated scanners are reliable at sweeping surface-layer weaknesses such as accidentally exposed files or missing headers, and they keep infrastructure clean. They do not catch operational logic defects, where the server forgets to ask whether this user is entitled to see this data. Authentication confirms who someone is at the door; authorisation is the guard inside the building who makes sure they only enter the rooms they are allowed into. That second question needs a human to ask it.
What happened, in plain words
A security company called NemoSecurity was hired to test two computer systems belonging to PT Panin Dai-ichi Life, an insurance company. One system is a learning website called Panindai Academy, where staff presumably take courses. The other is a small piece of software that hands out insurance policy details to other software, connected to a system called Salesforce.
The testers found two very different kinds of problem. On the learning website they found small housekeeping mistakes: files that should have been hidden were visible to anyone, and some standard protective settings were missing. Nothing dramatic, and all rated low.
On the insurance policy software they found something more serious. The software checked that a caller had a valid pass, but never checked whether that pass was allowed to look at the particular policy being asked for. Because policy numbers run in order (1, 2, 3...), anyone with a valid pass could walk through other people's policy records one number at a time. The finding was scored 6.5 under the CVSS 3.1 matrix.
Then something interesting happened. The client said the software is currently built for only one kind of user, so being able to see every policy is intended behaviour, not a bug. The finding was formally rejected. The testers noted that the moment a second kind of user is added, this "design" becomes a serious problem.
This article walks through both halves of the test in the order the report covers them, explaining every term as it comes up.
The two systems under test
Panindai Academy, the learning platform
A Learning Management System, or LMS, is a website where an organisation publishes courses, tracks who has completed them, and manages learner accounts. Think of it as a school intranet: there is a public-facing entrance, and behind it there are dashboards, course lists and user management screens.
The test focused on two modules inside it, named Agency (AGE) and Bancassurance (BAN). A module is simply one section of a larger application, the way a school website might have a separate section for students and another for teachers. Bancassurance is the practice of selling insurance through bank branches, so these two modules likely serve different groups of staff.
The API Inquiry Polis, the policy lookup service
An API (Application Programming Interface) is a way for two pieces of software to talk to each other without a human clicking anything. A useful comparison is a restaurant: you do not walk into the kitchen, you tell the waiter what you want, and the waiter brings it back. The API is the waiter. One program asks, another answers, and neither needs to know how the other is built inside.
"Inquiry Polis" means policy inquiry: the API's job is to answer the question "what are the details of insurance policy number X?". It is integrated with Salesforce, a widely used system for managing customer relationships, so the policy data likely lives in or passes through Salesforce.
The normal flow, as the report describes it, has two steps:
- The calling program asks for an authentication token.
- It then sends that token together with a policy number (
policyNo) and receives the policy record.
A token here is a short piece of text that acts like a claim ticket. You prove who you are once, you get the ticket, and afterwards you show the ticket instead of proving yourself again. A session cookie is the same idea in a web browser: a small file the site stores in your browser so it recognises you on the next page load. Neither is a password; both are proof that you already presented one.
How the testers approached it
Two testing methods were combined across the engagement. An engagement is simply the period of work covered by the contract.
- Black box. The tester sits outside with no access at all, like a stranger trying the front door of an office with no key and no insider knowledge. This was used early, to map the attack surface and to find information that had been exposed to the public by accident. The attack surface is everything an outsider can see and touch: every page, every file, every response the system gives without being asked who you are.
- Grey box. The tester is given limited access, in this case an official user account and an administrator account, so that features behind the login can be evaluated. This is like being handed a visitor badge and a staff badge: you can now walk the corridors and test the internal doors, not just the lobby.
The combination matters because it tests both the front door and the internal partitions behind it. A black-box test alone would never see the dashboard; a grey-box test alone would never notice what a stranger can find from outside.
The tools named in the report, grouped by what they are for:
| Phase | Tool |
|---|---|
| Reconnaissance | httpx, WhatWeb |
| Automated scanning | Nuclei, Xray |
| Manual API manipulation | Burp Suite, Postman |
Reconnaissance means gathering information before attacking anything: what software is this, what version, what files exist. httpx and WhatWeb are programs that probe a website and report back what technology it appears to use. Automated scanning means running a program that tries hundreds of known weaknesses in sequence, much faster than a person could. Nuclei and Xray are such scanners. Burp Suite and Postman are tools for sending requests to an API by hand and editing them before they go out, which is how a tester changes one value and watches what happens.
Finding it
The LMS: infrastructure hygiene
Reconnaissance with httpx and WhatWeb identified the platform as a Laravel application running on Nginx on Ubuntu. Three product names in one sentence, so in plain terms: Laravel is a toolkit that programmers use to build websites in the PHP language; Nginx is the web server program that receives visitors' requests and hands them to the application; Ubuntu is the operating system, the same family as the Linux you may have heard of. Knowing all three tells a tester which known weaknesses are worth trying.
Automated scanning with Nuclei and Xray did not surface large-scale critical vulnerabilities such as SQL injection or lethal Cross-Site Scripting.
SQL injection is a classic attack where a tester slips database instructions into a form field, hoping the site will run them. Imagine a librarian who takes your written request and reads it out to the shelves literally: if you write "the book on cats, and also hand me the staff payroll", a careless librarian fetches both. Cross-Site Scripting, or XSS, is the trick of getting your own code to run inside someone else's browser on a trusted site, so that the site itself appears to deliver the malicious content.
Neither was found. What the scans did highlight was configuration hygiene, meaning how tidy and careful the setup of the server is:
- Configuration files such as
.htaccessand.DS_Storecould be accessed directly by the public, which leaks hints about the internal directory structure of the application. - A number of standard security headers, including CSP and HSTS, were not implemented.
- Session cookies were not equipped with the full set of protective flags.
Taking those one at a time. A .htaccess file is a small settings file used by web servers to control access to a folder; it is not meant to be read by visitors, but if the server is misconfigured it can simply be downloaded like any other file. .DS_Store is a file that Apple's macOS creates automatically when you open a folder in Finder, storing things like icon positions; it has no business being on a public web server, and it can reveal the names of files in that folder. Directory structure means the layout of folders inside the application, which is a map an attacker would otherwise have to guess.
Security headers are extra lines the server adds to every response, instructing the browser to behave more safely. CSP, Content Security Policy, tells the browser which sources of code and content are allowed on the page, which blunts XSS. HSTS, HTTP Strict Transport Security, tells the browser to only ever connect over the encrypted version of the site, never the plain one. Cookie flags are small labels attached to a cookie that restrict how it can be used, for example preventing JavaScript on the page from reading it or stopping it being sent over an unencrypted connection.
All of these were classified as Low or Informational severity. Severity is the rating of how much damage a weakness could realistically cause; Informational is the lowest rung, meaning "worth noting, not worth panicking about".
The report's reasoning is that a suboptimal configuration does not always give an attacker a direct way in, but it does indicate that the release standard for the system is not strict. The analogy used is a building with an unlocked window on an upper floor: hard to reach directly, but dangerous if the attacker finds a staircase through some other flaw. In other words, each small weakness is survivable on its own, but weaknesses combine, and a tidy server removes the footholds.
The API: a parameter that was trusted too much
The API Inquiry Polis was tested manually with Burp Suite and Postman. Manual here means a person editing requests and reading responses, rather than a scanner firing a fixed list. The tester manipulated parameters and identified an Insecure Direct Object Reference (IDOR), which in modern API terminology is described as Broken Object Level Authorization (BOLA).
Both names describe the same mistake, and it is worth unpacking because it is the heart of the report. A parameter is a value you send along with a request, like the "policy number" field on a form. "Direct object reference" means the request names the thing it wants directly, by its identifier, rather than by some indirect route. IDOR means the server takes that identifier at face value and hands over whatever it names. BOLA is the newer name used in API security: the authorisation check is missing at the level of the individual object, meaning the individual record.
A comparison: a hotel receptionist who checks that you are a guest, then gives you a key to any room number you say out loud. You are a legitimate guest, so the first check passes. Nobody asks whether room 214 is yours.
The problem is in how the server validates a request. It confirms that the token presented is valid, but it does not check whether the owner of that token is entitled to view the policy number being requested. Because policyNo is sequential, keeping the same token and simply changing the value is enough to reach another person's policy data. Sequential means the numbers follow one another: if your policy is 100234, someone else's is 100235. No guessing is required, only counting.
Exploitation
Step 1: obtain a token
The caller requests an authentication token from the API. The report describes this step but does not reproduce the request, so the exact endpoint, method and body are not available here. An endpoint is the specific address within an API that performs one job, the way a phone extension reaches one desk. The method is the type of request, such as asking for data or submitting data.
Why this step comes first: everything after it depends on having a valid ticket. Without a token, the server would refuse at the door, and the tester would learn nothing about what happens once you are inside.
Step 2: request a policy with the token
The token is presented together with a policyNo to retrieve the policy record. Again the report describes the flow without reproducing the raw request.
Why this step comes before the tampering: the tester first needs to see a normal, successful answer. That establishes what a correct response looks like, so that when something changes later, the tester can tell whether the change came from the tampering or was there all along.
Step 3: change only the policy number
With the same token retained, the tester changed the value of policyNo. Because the numbers are sequential, a neighbouring value belongs to a different policyholder. The tester could access another person's policy data, which shows the token's validity was checked but its authorisation over that specific object was not.
The report does not include the literal request or response for this step.
The discipline in this step is that only one thing changed. If the tester had also changed the token or the endpoint, a success would prove nothing, because nobody could say which change caused it. By holding everything else fixed and moving the policy number by one, the result points at exactly one cause: the missing ownership check.
Root cause
The server performs authentication but not object-level authorisation. Two words that sound alike and mean different things:
- Authentication answers "who are you?" It is the bouncer checking your ID at the door.
- Authorisation answers "what are you allowed to do here?" It is the usher inside who checks your ticket against the seat number.
The server verifies that the token is valid, and stops there. It never asks whether the identity behind the token is allowed to see the requested policyNo. The sequential nature of the policy numbers makes the missing check very susceptible to mass exploitation. Enumerable means you can walk through the whole set in order, like reading page numbers in a book; brute force would mean trying random values and hoping, which is far slower and noisier.
Existing defences did not stop it because the only control in the path was token validity. The report does not describe any additional ownership check, rate limiting or response filtering that would have interfered. Rate limiting would be a cap on how many requests one caller can make in a period, which would at least have slowed a walk through the numbers; response filtering would be logic that strips fields the caller should not see.
Impact
The exposed data includes personal information such as name and date of birth, and financial data such as policy status and premium amount. A premium is the regular amount a policyholder pays for their insurance cover, so this is not merely embarrassing data but commercially sensitive data about individuals.
Because policy numbers are sequential, the flaw is very susceptible to mass exploitation. Mass exploitation means doing it at scale: a script could request thousands of numbers in sequence and collect the answers, without any cleverness at all.
CVSS is a standard scoring system for vulnerabilities, producing a number from 0 to 10 where higher means more serious; 3.1 is the version of the scoring rules used.
The report is careful about the conditions. In theory, and by global security standards, a user being able to reach a third party's data without authorisation is a fatal flaw. The client clarified, however, that at present the application is designed to hold a single user role only. A role is a category of user with a defined set of permissions, such as "administrator" or "customer". Single role means there is only one category, so in principle every user is meant to see the same things.
Under that architecture, the ability to view every policy number is considered by design rather than a vulnerability. "By design" means the behaviour is what the product was built to do, even if it looks alarming from outside. On that operational argument the high-risk finding was formally rejected as something requiring immediate remediation. Remediation means the fix.
The report keeps the strategic caveat: if the application later grows and adopts a multi-user role structure, this design becomes technical debt that is very dangerous if it is not mitigated early. Technical debt is the accumulated cost of a shortcut taken now that will have to be paid later, the software equivalent of postponing repairs on a building. Mitigated means reduced or controlled.
Fix
No fix was applied. The finding was rejected by the client on the single-role argument above, so the report records no code change, configuration change or retest.
The report warns that if multi-user roles are introduced, this design becomes technical debt that is very dangerous if not mitigated early.
Why track it rather than forget it: a rejected finding is not the same as a solved one. If the record survives, the next person to add a second role has a note waiting for them. If it does not, the same behaviour silently changes from intended to dangerous overnight.
Variants to test
These are the generalised versions of the same idea, useful when testing other systems.
- Sequential object identifiers on any token-protected endpoint. Take a valid token, request your own object, then change the identifier to a neighbouring value. A positive result is another party's record being returned.
- Identifier formats other than plain integers. A UUID is a long random-looking identifier; zero-padded means 000123 rather than 123. A positive result is the same cross-account data return through any of those channels.
- Role assumptions that are only documented, not enforced. Where a product claims a single-role design, check whether the API itself enforces that assumption or merely relies on there being one role today. A positive result is an endpoint that returns data for an object the caller does not own, which will become exploitable the day a second role is added.
- Exposed configuration and metadata files. Request
/.htaccess,/.DS_Storeand similar paths directly. A positive result is a readable file that discloses directory structure or other internal hints. - Missing security headers and cookie flags. Inspect responses for CSP, HSTS and the full set of cookie protective attributes. A positive result is their absence, which is low severity on its own but raises the value of any other flaw found.
Closing observation
The two halves of this engagement show a pattern worth keeping. Automated scanners are reliable at sweeping surface-layer weaknesses such as accidentally exposed files or missing headers, and they keep infrastructure clean. They do not catch operational logic defects, where the server forgets to ask whether this user is entitled to see this data. Authentication confirms who someone is at the door; authorisation is the guard inside the building who makes sure they only enter the rooms they are allowed into. That second question needs a human to ask it.
Glossary
- API (Application Programming Interface): a defined way for one piece of software to ask another for data or actions, without a human operating a browser.
- Attack surface: everything an outsider can see or reach on a system without credentials.
- Authentication: proving who you are, for example by presenting a token or logging in.
- Authorisation: deciding what an identified user is allowed to see or do.
- Black box testing: testing with no inside access or knowledge, as an outsider.
- BOLA (Broken Object Level Authorization): the API-era name for a missing check on whether the caller may access the specific record requested.
- Brute force: trying many values, often randomly, until one works.
- Burp Suite: a tool for intercepting and editing web and API requests by hand.
- By design: behaviour that is intended by the product's specification rather than a mistake.
- Configuration hygiene: how tidy, minimal and careful a server's setup is.
- Cookie: a small piece of data a website stores in your browser so it can recognise you later.
- Cookie flags: labels on a cookie that restrict how it can be read or sent.
- CSP (Content Security Policy): a response header telling the browser which sources of content are allowed on the page.
- CVSS: a standard 0 to 10 scoring system for rating the severity of a vulnerability; 3.1 is a version of it.
- Directory structure: the layout of folders and files inside an application.
- Endpoint: one specific address within an API that performs a particular job.
- Engagement: the contracted period of security testing work.
- Enumerable: able to be walked through in order, one value after another.
- Grey box testing: testing with partial inside access, such as ordinary user and administrator accounts.
- HSTS (HTTP Strict Transport Security): a response header telling the browser to use only the encrypted version of the site.
- httpx: a tool that probes web hosts and reports what responds.
- IDOR (Insecure Direct Object Reference): a flaw where a request names a record directly and the server returns it without checking ownership.
- Informational severity: the lowest rating, meaning noted but not a real risk on its own.
- Laravel: a toolkit for building web applications in the PHP language.
- LMS (Learning Management System): software for publishing courses and managing learners.
- Mass exploitation: carrying out an attack at scale, often with a script.
- Method: the type of an API request, such as asking for data or submitting data.
- Mitigation: reducing or controlling a risk, which is not always the same as removing it.
- Module: one section of a larger application.
- Nginx: a web server program that receives requests and passes them to an application.
- Nuclei: an automated scanner that runs a large library of known checks.
- Parameter: a value sent with a request, such as a policy number.
- Postman: a tool for composing and sending API requests by hand.
- Premium: the amount a policyholder pays for insurance cover.
- Rate limiting: a cap on how many requests a caller may make in a given period.
- Reconnaissance: gathering information about a target before testing it.
- Remediation: the fix for a vulnerability.
- Role: a category of user with a defined set of permissions.
- Salesforce: a widely used system for managing customer relationships and data.
- Sequential: following one another in order, such as 1, 2, 3.
- Session cookie: a cookie that identifies your logged-in session to a website.
- Severity: a rating of how much harm a weakness could cause.
- SQL injection: an attack that slips database instructions into input so the database executes them.
- Technical debt: the future cost of a shortcut accepted today.
- Token: a piece of text issued after authentication and presented afterwards as proof of identity.
- Ubuntu: a Linux-based operating system.
- UUID: a long identifier, usually random-looking, used to name an object.
- WhatWeb: a tool that identifies the technologies a website is built with.
- Xray: an automated web vulnerability scanner.
- XSS (Cross-Site Scripting): an attack that gets attacker-controlled code to run in another user's browser on a trusted site.