Location Research Breakthrough Possible @S-Logix pro@slogix.in

Decision Tree-Based Detection of Broken Object Level Authorization Attacks in OWASP Juice Shop Through API Access-Control Analysis

Description

Modern web applications use Application Programming Interfaces (APIs) to manage user accounts, retrieve application data, access individual objects, and perform operations on application resources. These APIs commonly process object identifiers, such as user IDs, order IDs, product IDs, or resource identifiers, to determine which object a client is requesting.

Broken Object Level Authorization (BOLA) occurs when an API fails to verify whether the authenticated user has permission to access or modify a particular object. An attacker may manipulate an object identifier in an API request and attempt to access another user's resource.

BOLA is an important API security risk because successful exploitation may expose sensitive information or permit unauthorized modification of another user's data. Proper object-level authorization requires the application to verify access permissions for every relevant operation.

In this use case, OWASP Juice Shop is deployed within an isolated cybersecurity laboratory. Kali Linux is used as the controlled security-testing environment, while Ubuntu Linux hosts the application and machine-learning analysis workflow.

An existing public API security dataset is used as the data source for the machine-learning stage. The available records, labels, and request attributes are inspected to determine whether they support the proposed authorization-related classification task. Suitable labelled records are selected and processed to establish the features required for Decision Tree training.

A Decision Tree classifier, implemented using Scikit-learn, is used to classify API-request observations based on the patterns learned from the available labelled data. The model evaluates selected request characteristics and produces a classification that can help identify potentially suspicious API access activity.

The trained model is subsequently evaluated using compatible API requests captured during normal application activity and a controlled BOLA testing scenario against the local OWASP Juice Shop environment.

During the controlled test, requests are generated using authorized laboratory accounts. The test examines whether an authenticated test user can access an object that belongs to another test user without the required authorization. The requests and responses are captured and processed using the same feature-extraction procedure used during training.

The Decision Tree model classifies the processed request features, and its predictions are compared with the known authorization-test results. Suspicious requests are flagged for further investigation. The application’s actual authorization behavior is evaluated separately because a machine-learning prediction does not itself enforce object-level access control.

The complete workflow is:
Public API Security Dataset
→
Dataset Inspection
→
Label and Feature Assessment
→
Data Preprocessing
→
Feature Extraction
→
Decision Tree Training
→
OWASP Juice Shop Deployment
→
Normal API Activity
→
Controlled BOLA Attack Simulation
→
API Request Capture
→
Authorization Verification
→
Consistent Feature Extraction
→
Decision Tree Classification
→
Suspicious Access Identification
→
Detection Result Validation
→
Performance Evaluation

Existing Security Problem

Application: OWASP Juice Shop

OWASP Juice Shop is an intentionally vulnerable web application designed for security training, awareness, and authorized security testing. It contains application security challenges and can be used to examine web and API security behavior within a controlled environment.

In this use case, OWASP Juice Shop provides the application environment for API access-control testing. The relevant API endpoints and object-access behavior must be examined before selecting a suitable BOLA test scenario.

Existing Problem:

APIs frequently accept object identifiers through request paths, query parameters, or request bodies. An application must verify that the authenticated user has permission to perform the requested operation on the identified object.

If the application checks authentication but fails to verify object ownership or access permissions, a user may be able to access resources belonging to another user.

Traditional security testing can identify authorization weaknesses through controlled request manipulation and response inspection. However, identifying suspicious access behavior across multiple requests may require additional analysis of request characteristics and authorization outcomes.

A machine-learning-based classification mechanism can provide supplementary detection by learning patterns from suitable labelled API security data. Its effectiveness depends on the quality of the dataset, the selected features, and the similarity between the training records and the application traffic being evaluated.

The security problem is:
API-Driven Application
→
Authenticated User Requests
→
Object Identifier Included in API Request
→
Object-Level Authorization Check Required
→
Potentially Missing or Incorrect Authorization Check
→
Unauthorized Object Access Attempt
→
Potential Exposure or Modification of Another User's Data
→
API Request and Response Evidence Generated
→
Requirement for Authorization Testing
→
Requirement for ML-Based Suspicious Access Detection
→
Requirement for Detection Validation

The proposed solution combines public-dataset-based Decision Tree training with controlled BOLA testing in OWASP Juice Shop. Captured requests are classified using the trained model, while the actual authorization outcome is verified independently using the known laboratory test conditions.

Attack

Specific Attack: Controlled Broken Object Level Authorization Attack Against OWASP Juice Shop

The controlled attack scenario evaluates whether an authenticated test user can access an object that belongs to another test user by manipulating an object identifier in an API request.

OWASP Juice Shop is deployed within the isolated laboratory environment. Kali Linux is used as the authorized security-testing system, while OWASP ZAP and cURL support request inspection and controlled HTTP testing.

The test uses separate laboratory accounts and application resources. A legitimate request is first generated to establish the normal access behavior. A controlled request is then modified to reference a different test user's object, where the application exposes a suitable test scenario.

The application response is inspected to determine whether the requested object is accessible to the authenticated user. An unauthorized access attempt is not automatically considered successful BOLA exploitation; the response and actual object-access result must support that conclusion.

The captured requests and their associated metadata are processed using the same feature-extraction workflow established for the machine-learning model.

The Decision Tree classifier evaluates the prepared request features and produces a prediction based on the classes learned during training. The prediction is compared with the independently verified authorization-test result to evaluate detection effectiveness.

Attack Behavior:
Kali Linux Security-Testing Environment
→
OWASP Juice Shop Local Application
→
Authentication Using a Laboratory Test Account
→
Legitimate Object Access Request
→
Controlled Object Identifier Modification
→
Request for Another Test User's Object
→
API Request and Response Capture
→
Object-Level Authorization Verification
→
Request Feature Extraction
→
Decision Tree Classification
→
Suspicious Access Identification
→
Comparison with Verified Authorization Results
→
Detection Result Validation

Security Concept

Decision Tree-Based Detection of BOLA Through API Access-Control Analysis

The primary security concept is Supervised Machine-Learning-Based Detection of Suspicious API Authorization Activity.

The first objective is to identify an existing public API security dataset containing suitable labelled records for the intended classification task. The dataset is inspected to determine whether its labels and request attributes represent authorization-related behavior that can support the proposed experiment.

The second objective is to transform the selected records into numerical features. These features may represent available request characteristics, object-related information, authentication context, response status, and other attributes that can be extracted consistently from the selected data.

The third objective is to train a Decision Tree classifier using the prepared features and verified labels. The model learns classification rules from the training examples and applies them to compatible unseen request observations.

The fourth objective is to validate the model using normal API requests and a controlled BOLA test performed against OWASP Juice Shop. The model's predictions are compared with independently verified authorization outcomes.

The final objective is to evaluate whether the Decision Tree can identify suspicious authorization-related activity under the tested conditions and to document its limitations.

The assessment follows:
Public API Security Dataset
→
Dataset Suitability Assessment
→
Label Verification
→
Data Preprocessing
→
API Request Feature Extraction
→
Decision Tree Model Training
→
Model Evaluation
→
OWASP Juice Shop API Testing
→
Controlled BOLA Attack Simulation
→
Request Capture and Authorization Verification
→
Consistent Feature Extraction
→
Decision Tree Classification
→
Suspicious Access Flagging
→
Detection Performance Evaluation

Defensive Mechanism

The security concept defines the overall security strategy.

The following are the specific defensive mechanisms implemented.

Public Dataset-Based Classification Training:

An existing public API security dataset is inspected and processed to identify suitable labelled records.

Purpose: Establish a reproducible data source for training and evaluating the classification model.

API Request Feature Extraction

Relevant request and response characteristics are transformed into a numerical representation compatible with the Decision Tree classifier.

Purpose
  • Provide consistent input features for model training and request classification.

Decision Tree Classification

The trained Decision Tree classifies API-request observations according to patterns learned from the labelled training records.

Purpose
  • Identify requests whose features match the suspicious-access patterns represented in the training data.

Object-Level Authorization Verification

Controlled requests are examined to determine whether the authenticated user is permitted to access the requested object.

Purpose
  • Establish the actual authorization outcome independently of the model prediction.

Suspicious Access Flagging

Requests classified as suspicious are marked for further security investigation.

Purpose
  • Help prioritize potentially unauthorized API activity for review.

Controlled Attack Validation

The classification results are compared with the independently verified outcomes of the controlled BOLA test.

Purpose
  • Evaluate whether the model identifies the intended suspicious access behavior.

Detection Performance Evaluation

The predictions are compared with suitable ground-truth labels and verified laboratory test results.

Purpose
  • Measure classification performance and identify false positives, false negatives, and generalization limitations.

Application Authorization Enforcement

The application must perform an appropriate object-level authorization check for each protected operation. If the test identifies a missing authorization control, the application-side control must be corrected or an appropriate enforcement mechanism implemented.

Purpose
  • Prevent unauthorized object access independently of the machine-learning classification result.

Security Tools

Primary Vulnerable Application: OWASP Juice Shop

OWASP Juice Shop provides the application environment for controlled API security testing.

Purpose
  • Provide a local application testing target.
  • Generate normal application requests.
  • Support authorized access-control testing where suitable scenarios are available.
  • Provide an environment for validating API security findings.

Security Testing Platform: Kali Linux

Kali Linux provides the controlled security-testing environment.

Purpose
  • Generate authorized API test requests.
  • Perform controlled object-access tests.
  • Support repeatable BOLA testing.
  • Preserve the context of the laboratory test activity.

Application and Analysis Environment: Ubuntu Linux

Ubuntu Linux hosts the application and machine-learning analysis components according to the laboratory configuration.

Purpose
  • Run the required application components.
  • Execute Python-based data processing.
  • Train and evaluate the Decision Tree model.
  • Store captured test evidence.

Virtualization Platform: VirtualBox

VirtualBox provides the isolated laboratory infrastructure.

Purpose
  • Host Ubuntu and Kali Linux virtual machines.
  • Separate the application from the security-testing environment.
  • Support controlled network communication.
  • Reduce the risk of unintended interaction with external systems.

HTTP/API Inspection Tool: OWASP ZAP

OWASP ZAP is used to inspect HTTP requests and responses associated with the local application.

Purpose
  • Inspect API traffic.
  • Capture relevant requests and responses.
  • Preserve access-control testing evidence.
  • Support comparison of legitimate and controlled unauthorized access attempts.

HTTP Request Tool: cURL

cURL is used to send reproducible HTTP/API requests to the authorized laboratory application.

Purpose
  • Generate legitimate API requests.
  • Send controlled authorization-test requests.
  • Observe response status codes and response content.
  • Support repeatable testing.

Network Discovery Tool: Nmap

Nmap is used to identify services exposed by the authorized laboratory environment.

Purpose
  • Discover the local application service.
  • Identify the relevant listening port.
  • Verify the expected laboratory service exposure.

Programming and Automation Tool: Python

Python provides the primary implementation environment for the classification and validation workflow.

Purpose
  • Process dataset records.
  • Extract API-request features.
  • Integrate the Decision Tree classifier with captured traffic.
  • Automate classification and evaluation.

Machine-Learning Library: Scikit-learn

Scikit-learn provides the Decision Tree classification implementation and evaluation utilities.

Purpose
  • Train the Decision Tree classifier.
  • Generate predictions for compatible request features.
  • Evaluate classification performance.
  • Produce confusion-matrix and classification-metric results.

Data Processing Tool: Pandas

Pandas is used to load, filter, transform, and organize the existing public dataset and captured API records.

Purpose
  • Inspect dataset structure and labels.
  • Select suitable training records.
  • Organize captured API traffic.
  • Prepare classification and evaluation results.

Numerical Processing Tool: NumPy

NumPy supports numerical operations during feature preparation and model processing.

Purpose
  • Prepare numerical feature arrays.
  • Support data transformations.
  • Assist with feature-matrix processing.

Dataset Source: Public API Security Dataset

An existing public API security dataset is used as the data source for the classification experiment. Its available records, labels, metadata, and usage terms are reviewed to determine whether it supports authorization-related classification.

Purpose
  • Provide existing API security records for analysis.
  • Support selection of suitable labelled training examples.
  • Provide data for feature extraction and Decision Tree training.
  • Support evaluation where compatible ground-truth labels are available.

Database: SQLite

SQLite provides local storage for captured requests and classification results.

Purpose
  • Store relevant request metadata.
  • Record Decision Tree predictions.
  • Maintain independently verified authorization-test results.
  • Preserve evaluation evidence.

Process

STEP 01

Prepare the Isolated Cybersecurity Laboratory

  • Create the laboratory using VirtualBox.
  • Configure Ubuntu Linux as the application and analysis environment.
  • Configure Kali Linux as the controlled security-testing system.
  • Establish the intended laboratory network connectivity.
  • Verify that the virtual machines can communicate as required.
  • Confirm that all security testing is restricted to the authorized laboratory environment.
  • Record the relevant virtual-machine and network configuration.
Tools: VirtualBox + Ubuntu Linux + Kali Linux
STEP 02

Deploy OWASP Juice Shop

  • Deploy OWASP Juice Shop in the isolated laboratory using its documented setup procedure.
  • Configure the required application components.
  • Start the application services.
  • Verify that the application is operational.
  • Confirm that the application is accessible from the authorized testing environment.
  • Record the application address and relevant service configuration.
Tools: OWASP Juice Shop + Ubuntu Linux + VirtualBox
STEP 03

Establish the Normal Application Activity Baseline

  • Access OWASP Juice Shop using its intended application functionality.
  • Perform legitimate application operations.
  • Generate normal application requests.
  • Inspect the corresponding HTTP requests and responses.
  • Record available request characteristics, such as HTTP method, path, parameters, timestamps, response status, and other relevant metadata.
  • Preserve representative normal-activity records for comparison with the controlled authorization test.
Tools: OWASP Juice Shop + OWASP ZAP + cURL
STEP 04

Verify Local Application Service Exposure

  • Identify the authorized OWASP Juice Shop laboratory target.
  • Perform controlled service discovery from Kali Linux.
  • Identify the relevant application service and listening port.
  • Verify that the service is reachable through the intended laboratory network.
  • Record the service exposure information.
  • Confirm that testing is directed only at the local application.
Tools: Kali Linux + Nmap
STEP 05

Obtain and Inspect the Public API Security Dataset

  • Obtain an existing public API security dataset from its available public source.
  • Review the dataset documentation, available fields, labels, and usage terms.
  • Inspect the available records to determine whether they contain suitable authorization-related API-request examples.
  • Identify the request attributes and classification labels that can support Decision Tree training.
  • Assess whether the selected dataset features are compatible with API traffic captured from OWASP Juice Shop, and document any limitations.
Tools: Python + Pandas
STEP 06

Assess Dataset Suitability for BOLA Classification

  • Review the available classification labels and associated API-request records.
  • Determine whether the dataset explicitly identifies BOLA-related or comparable authorization-related activity.
  • Check whether the available records distinguish legitimate object access from unauthorized object access.
  • Identify the request attributes available for classification.
  • Confirm that the selected labels are suitable for the proposed detection objective.
  • If the dataset lacks appropriate authorization-related labels, do not claim that it supports supervised BOLA classification. Identify a suitable public labelled source before proceeding with model training.
Tools: Python + Pandas
STEP 07

Preprocess the Selected Dataset

  • Load the selected records into the Python environment.
  • Inspect missing values, inconsistent fields, duplicate entries, and malformed records.
  • Clean or exclude unsuitable records where required.
  • Normalize the representation of relevant request attributes.
  • Preserve verified labels associated with each selected record.
  • Record the preprocessing operations and retain the original source data for verification.
Tools: Python + Pandas + NumPy
STEP 08

Extract API Authorization-Related Features

  • Identify the request characteristics supported by the selected dataset and the OWASP Juice Shop test traffic.
  • Where available, consider features such as HTTP method, endpoint structure, object-identifier presence, authentication context, response status, and other request-level attributes.
  • Use only features that can be extracted consistently from the training and test data.
  • Transform categorical attributes into numerical representations using fitted encoders.
  • Prepare the resulting feature matrix and corresponding labels.
  • Verify that the features are suitable for Decision Tree classification.
Tools: Python + Pandas + NumPy + Scikit-learn
STEP 09

Prepare Training and Evaluation Data

  • Separate the labelled records into training and evaluation portions.
  • Preserve the verified classification labels.
  • Fit preprocessing transformations using the training data and apply them consistently to the evaluation data.
  • Avoid data leakage caused by duplicate or closely related records appearing in both portions where this can be identified.
  • Review the class distribution.
  • Record the selected data-splitting strategy and the number of records in each portion.
Tools: Python + Pandas + Scikit-learn
STEP 10

Train the Decision Tree Model

  • Configure the Decision Tree classifier using Scikit-learn.
  • Select appropriate model parameters, such as tree depth and minimum samples required for splitting or leaf nodes.
  • Provide the prepared training features and their verified labels.
  • Train the model using the selected public dataset.
  • Preserve the trained model and its fitted feature-processing configuration.
  • Verify that the model can generate predictions for compatible input records.
Tools: Python + Scikit-learn
STEP 11

Evaluate the Initial Classification Model

  • Provide the held-out evaluation records to the trained Decision Tree
  • Generate predictions for the evaluation data.
  • Compare the predictions with the known evaluation labels
  • Calculate accuracy, precision, recall, and F1-score where appropriate.
  • Generate a confusion matrix to examine classification errors.
  • Review false-positive and false-negative results.
  • Record the actual evaluation metrics and identify limitations in the selected data or model.
Tools: Python + Scikit-learn + Pandas
STEP 12

Establish Normal API Access Behavior

  • Access OWASP Juice Shop using authorized laboratory accounts.
  • Perform legitimate operations involving the available application resources.
  • Capture the corresponding API requests and responses.
  • Determine which endpoints and object identifiers are relevant to the authorization assessment.
  • Record the expected access behavior for each tested account and resource.
  • Verify that the captured records can be processed by the established feature-extraction workflow.
Tools: OWASP Juice Shop + OWASP ZAP + cURL + Python
STEP 13

Perform the Controlled BOLA Attack Simulation

  • Use Kali Linux as the authorized security-testing environment.
  • Authenticate using a dedicated laboratory test account
  • Identify a suitable application endpoint that accesses an object using a request-supplied identifier.
  • Establish the legitimate access behavior for the test account.
  • Modify the object reference in a controlled request to refer to a resource belonging to another laboratory test account, where the application supports such a test scenario.
  • Send the request only to the local OWASP Juice Shop instance.
  • Observe the application response and verify whether unauthorized object access actually occurs.
  • Preserve the request and response evidence without modifying or deleting unrelated application data
Tools: Kali Linux + OWASP Juice Shop + cURL + OWASP ZAP
STEP 14

Capture and Verify the Authorization-Test Results

  • Capture the requests and responses associated with the controlled test.
  • Identify the relevant records using the known test time window and request metadata.
  • Preserve the original traffic evidence.
  • Compare the legitimate and modified requests.
  • Inspect the application response and the resource actually returned or modified.
  • Determine whether the requested object was accessible to the authenticated test user.
  • Record the verified outcome separately from any machine-learning prediction.
  • If the application does not expose a suitable BOLA scenario, document that limitation instead of claiming a successful attack.
Tools: OWASP ZAP + cURL + OWASP Juice Shop + Python
STEP 15

Preprocess the Captured API Requests

  • Load the captured request records into the Python analysis workflow.
  • Apply the same preprocessing and feature-extraction configuration established during training.
  • Reuse the fitted encoders and transformations.
  • Verify that the captured features have the expected dimensions and ordering.
  • Check that the public dataset and laboratory traffic are sufficiently compatible for meaningful classification.
  • If the feature representations are incompatible, revise the feature design or document the limitation before continuing.
  • Preserve the processed features and their corresponding original request references.
Tools: Python + Pandas + NumPy + Scikit-learn
STEP 16

Perform Decision Tree-Based Classification

  • Load the trained Decision Tree model and its fitted preprocessing configuration.
  • Provide the processed API-request features to the classifier.
  • Generate predictions for the captured requests.
  • Record the predicted class and associated request reference.
  • Compare the predictions with the independently verified authorization-test results.
  • Identify requests classified as suspicious and preserve the corresponding evidence.
  • Do not treat a suspicious prediction as proof of a successful BOLA attack.
Tools: Python + Scikit-learn + Pandas
STEP 17

Store Detection Evidence and Evaluation Results

  • Create the SQLite database for the experiment.
  • Define suitable tables for request metadata, classification predictions, verified authorization outcomes, and evaluation results.
  • Store the relevant request information and model predictions.
  • Associate each prediction with its original request record.
  • Preserve the verified test outcome separately from the model prediction.
  • Verify that stored records can be retrieved for final analysis.
Tools: Python + SQLite + Pandas
STEP 18

Perform Final Detection Validation and Security Review

  • Repeat the workflow using legitimate API activity and controlled authorization-test requests.
  • Review the public-data preprocessing and feature-extraction configuration.
  • Compare the Decision Tree predictions with the verified test outcomes.
  • Calculate appropriate classification metrics where reliable ground-truth labels are available.
  • Document false positives, false negatives, and differences between the public dataset and laboratory traffic.
  • Verify that any confirmed authorization weakness is addressed through application-level authorization enforcement or a separate preventive control.
  • Document the model configuration, captured evidence, classification results, and limitations.
  • Finalize the security assessment without claiming automatic prevention unless a separate enforcement mechanism has been implemented and tested.
Tools: Python + Scikit-learn + Pandas + SQLite + OWASP Juice Shop + OWASP ZAP + cURL + Kali Linux + Ubuntu Linux

Outcome

OWASP Juice Shop is deployed within an isolated VirtualBox laboratory to provide a controlled environment for API access-control testing.

An existing public API security dataset is obtained and inspected to determine whether its records, labels, and request attributes support the intended BOLA-related classification task.

Suitable labelled records are selected and processed into numerical features for Decision Tree training, without manually fabricating the primary training dataset.

The Decision Tree classifier is trained using the selected labelled records and evaluated against held-out data to measure its classification performance.

Normal API activity is generated and captured from the local OWASP Juice Shop application, establishing request-level evidence for the controlled authorization assessment.

A controlled BOLA testing scenario is performed using authorized laboratory accounts to examine whether object-level authorization is enforced when a request references another test user's resource.

The captured requests are processed using the established feature-extraction workflow and classified by the trained Decision Tree model.

The model predictions are compared with independently verified authorization-test outcomes to evaluate whether the selected features help identify suspicious object-access activity.

SQLite stores the relevant request metadata, classification predictions, verified authorization outcomes, and evaluation results in a structured format

The complete workflow demonstrates public-dataset assessment, supervised Decision Tree training, controlled BOLA attack simulation, API request capture, authorization verification, suspicious-access classification, and final detection validation. The results document the model's effectiveness and limitations while distinguishing anomaly or attack detection from actual authorization enforcement and prevention.