Explore our new Cybersecurity Terms Glossary, explained by our experts.

View the Glossary View the Glossary
PRIVIA

Cybersecurity Terms Glossary

What Is REST API Security?

REST API security covers authentication, per-object authorisation, input validation, and resource limits for interfaces that have no user interface to hide behind.

Illustration for the cybersecurity term REST API Security
Home / Blog / Cybersecurity Terms / What Is REST API Security?
17 November 2026

What Is REST API Security?

What Is REST API Security?

An API has no user interface to disguise its structure. Every endpoint, parameter, and object identifier is addressable directly, and the client enforcing rules in a browser is irrelevant because an attacker never uses it. REST API security is therefore mostly about doing a small number of things properly on the server: proving who is calling, deciding what that caller may touch, validating what they send, and limiting how much they can consume.

What Actually Goes Wrong

The OWASP API Security Top 10, updated in 2023, is unusual among such lists in how heavily it weights one theme. Three of the ten entries are authorisation failures: broken object-level authorisation, broken object property-level authorisation, and broken function-level authorisation. Together they describe an API that correctly identifies the caller and then fails to check what that caller is entitled to. The single most common finding in API testing is IDOR, which is the first of those three.

The 2023 revision added two entries worth noting. Unrestricted access to sensitive business flows covers automation abuse, such as bulk purchasing of limited stock, where no individual request is improper. Unsafe consumption of third-party APIs covers the trust placed in data returned by an upstream service, which is frequently validated far less rigorously than data from a user.

Authentication and Tokens

Use an established framework rather than inventing one. OAuth 2.0 with OpenID Connect for user-facing access, the client credentials grant for service-to-service calls, and mutual TLS where both ends can hold certificates. API keys identify an application, not a person, and should never be the only control on anything sensitive.

Where JSON Web Tokens are used, the implementation details decide whether they help:

Tokens belong in the request header, never in a URL, where they are recorded in access logs, proxy logs, browser history, and referrer headers.

The Inventory Problem

Improper inventory management reaches the Top 10 because it is so common. Organisations run API versions nobody remembers deploying: a /v1 left live after /v2 shipped, a staging host reachable from the internet, a partner integration built years ago by a team that has moved on. Older versions frequently lack the controls added later, so an attacker simply uses the one that was never updated.

The remedy is an inventory derived from evidence rather than from documentation. Gateway logs, DNS records, certificate transparency data, and traffic analysis all reveal endpoints that no specification mentions. Each one then needs an owner, a retirement date, or the same controls as the current version.

Controls That Carry the Weight

  1. Authorise at object level, every time. Scope queries by the authenticated subject so an endpoint cannot return a record belonging to someone else, as covered in broken access control.
  2. Control properties in both directions. Use explicit request and response models rather than binding the request body straight onto an entity or serialising the whole object back, which is how mass assignment and excessive data exposure both occur.
  3. Validate against the schema. If you publish an OpenAPI definition, enforce it at the gateway so types, formats, required fields, and sizes are checked before any handler runs.
  4. Apply rate limiting and payload size caps per consumer, with stricter limits on expensive operations and on authentication.
  5. Return errors that say nothing useful. Stack traces, framework versions, and differing messages for a missing record versus a forbidden one all assist enumeration.
  6. Log with the caller identity and object identifier, which is what makes breach scope assessable afterwards.

A Cautionary Case

On 19 January 2023, T-Mobile US reported that an attacker had used a single API to retrieve data on approximately 37 million customer accounts, with access beginning around 25 November 2022 and continuing undetected for roughly six weeks. The interface was working as built; what was missing was any limit on how much one caller could retrieve and any alerting on a pattern that was far outside normal use. Under UK GDPR a comparable failure would require notification to the ICO within 72 hours of discovery, and discovery is the part that monitoring determines. Our web application security testing covers REST APIs with a full role and object matrix rather than a scan of the documented endpoints.

FAQ – Frequently Asked Questions

Is an API Gateway Enough to Secure an API?

No, though it is a useful layer. A gateway handles authentication, transport security, schema validation, and rate limiting well, which removes a lot of noise. It cannot decide whether this particular caller is entitled to this particular record, because that depends on application data. Object-level authorisation has to live in the service, close to the query.

Are JWTs More Secure Than Session Cookies?

They are different rather than better. Tokens scale without shared session state, which suits distributed services, and that same property makes revocation hard: a stolen token remains valid until it expires. Session cookies can be invalidated instantly server side. Choose based on your architecture, and if you use tokens, keep them short-lived with revocable refresh tokens.

How Do We Find APIs We Have Forgotten About?

Work from evidence rather than documentation. Gateway and load balancer logs show what is actually being called, DNS records and certificate transparency logs reveal hosts, and mobile application bundles often contain endpoints no web client uses. Compare the result with your specification; the gap is usually old versions, partner integrations, and environments that were meant to be internal.

Should an Internal API Be Secured Differently?

It should be secured, which many are not. Internal services are reached through server-side request forgery, a compromised container, a supplier connection, or an employee’s browser, so network position is a weak boundary. Apply authentication between services, ideally mutual TLS, and enforce authorisation on the data, treating the internal network as untrusted.

Related Terms

You May Be Interested In These

What Is John the Ripper?

Cybersecurity Terms

17 November 2026

What Is John the Ripper?

Read More
What Is ISO 27001?

Cybersecurity Terms

17 November 2026

What Is ISO 27001?

Read More