BOLA Detection
BOLA (broken object level authorization) is an attack in which an authenticated user reaches objects they have no right to by changing identifiers. Each request looks like a legitimate one, so signatures rarely catch it. The Web Security app judges by whether one subject handles far more distinct objects than usual.
How it judges
- Requests are normalized to URL templates, and only the values of Object ID parameters are extracted.
- For each subject (source IP), template and parameter, the number of distinct values handled within a time range (the object count) is counted.
- The count is compared with the baseline of the same template and parameter; above the threshold, it is judged object enumeration (BOLA).
The threshold is set per template and parameter. An API where bulk reads are normal and an API where a user handles a few objects each get their own threshold.
Baselines
Baselines are behavior profiles built from the last 30 days of web logs. They are rebuilt every day at 04:00.
| Behavior profile | Time range |
|---|---|
websec-bola-baseline-5m | 5 minutes |
websec-bola-baseline-1h | 1 hour |
A baseline holds these values per template and parameter.
samples: The number of samples, one per subject and time rangelog_objects_avg,log_objects_stddev: The mean and standard deviation of the log of the object count plus oneobjects_p99,objects_max: The 99th percentile and the maximum of the object count, for reference
Threshold
The threshold is the larger of exp(mean + 3 × standard deviation) - 1 rounded up, and 10.
- Legitimate users handle a few objects per time range, with an occasional bulk job. In such a skewed distribution, the plain mean and standard deviation are pulled hard by a single large value, so they are computed on the log.
- A template the baseline does not know (a new API), or one with fewer than 30 samples, uses 10 as the threshold. New APIs are not left out.
Batch rules
The app installs these two rules disabled. Enable them in Policies → Batch Rules after building the baselines.
| Rule | Schedule | Target |
|---|---|---|
| BOLA 객체 열거 의심 (5분) | Every 5 minutes | The last 5 minutes. Fast enumeration by AI agents or scripts |
| BOLA 객체 열거 의심 (1시간) | Every hour | The last hour. Slow enumeration that stays under the 5-minute baseline |
- MITRE ATT&CK mapping: Collection (TA0009), Data from Information Repositories (T1213).
- Events of the same subject are suppressed for an hour, tickets for a day.
Events carry these fields.
| Field | Description |
|---|---|
subject | The subject (source IP) |
host, method, path_template, param_name | The template and parameter |
objects | Distinct objects handled within the time range |
requests | Request count |
denied | Number of 401, 403 and 404 responses |
threshold | The threshold |
z_score | How far from the baseline: standard deviations above the mean on the log scale |
objects_max | The baseline maximum object count |
first_seen, last_seen | First and last request time |
Many denied mean the subject was refused while reaching other people's objects. Few denied with a large objects may mean objects were exposed without an authorization check, which is more serious.
Tuning
Change the options of the websec-score-bola-batch command in the batch rule queries to tune the sensitivity.
| Option | Default | Meaning |
|---|---|---|
min-objects | 10 | Object counts at or below this are never judged BOLA |
sigma | 3 | How many standard deviations above the mean, on the log scale, the threshold lies. Lower is more sensitive |
min-samples | 30 | Below this many baseline samples, only min-objects judges |
With many false positives, check the following first.
- Public page names are not set to Object ID.
- Whether IPs of legitimate bulk jobs (admin exports, sync scripts) show up. If so, add them as exceptions to the rule.
Querying directly
You can run the same judgment as the batch rules as a query.
log schema=web duration=1h
| eval host = _table, subject = string(src_ip)
| websec-normalize-path-batch
| search isnotnull(path_template)
| websec-extract-params-batch
| search param_type == "id"
| eval window = datetrunc(_time, "5m"), denied = if(status == 401 or status == 403 or status == 404, 1, 0)
| stats dc(param_value) as objects, count as requests, sum(denied) as denied by host, method, path_template, param_name, subject, window
| eval baseline_key = lower(concat(host, " ", method, " ", path_template, " ", param_name))
| websec-score-bola-batch baseline=websec-bola-baseline-5m
| sort limit=20 -objects