API security in India: close the leaks in your APIs, keys and code supply chain

By the DPDP Ready team, led by Deepak MittalChecked against the Act and G.S.R. 846(E)Updated 2 min plain · 10 min detailedView as Markdown
Where this sits in the life of a record

Apps and websites talk to their servers through APIs. Many data leaks happen there: an API hands out more than it should, or shows a customer's record to anyone who asks for it. Leaked passwords for systems, and weak spots in the outside code you build on, are the other common way in. From 13 May 2027, the law treats this as weak security.

₹250 croremaximum penalty for weak security
72 hoursto send the regulator the full breach report
1 yearto keep logs of who accessed what

What it means for you

  • Every API that touches customer data must check who is asking and whether that record is theirs.
  • Old and forgotten APIs count too. If it is still running, it can still leak.
  • System passwords and keys must not sit in your code. Keep them in a locked store and change them regularly.
  • Know which outside code your apps use, so you can fix it fast when a flaw is found.
  • If a vendor that handles data for you has a weak API, the leak is still your problem.
Example: A diagnostics lab in Indore lets patients download reports in its app. A curious user changes the report number in the link and sees a stranger's blood test. The lab now has a data leak to report to the Data Protection Board, the new regulator, and to every patient affected, all from one missing check.

What to do

  1. List every API you run, including old versions and test servers.
  2. Check that each one confirms who is asking and what they may see.
  3. Move keys and passwords out of code into a secure store, and change any that were exposed.
  4. Keep a list of the outside code in each app and watch it for known flaws.
  5. Add security checks to the way you build and release software.

The law: sections 8(1), 8(2), 8(5) and 8(6) of the DPDP Act and Rules 6 and 7 of the DPDP Rules, 2025. Applies from 13 May 2027.

Short answer

Personal data often leaks through APIs that return more than they should or do not check whose record is being asked for, and through leaked keys or compromised dependencies. Under the DPDP Act, that is a failure of the reasonable security safeguards in section 8(5) and Rule 6, and an exposure of personal data is often a breach to report under Rule 7. These duties apply from 13 May 2027.

Key takeaways

  • Broken object level authorisation is the first risk in the OWASP API Security Top 10 (2023): check whose record is asked for on every request.
  • Forgotten APIs, old versions and test endpoints are part of your attack surface; you cannot protect what you have not listed.
  • Keys in code, chat or build logs are a common route in. Keep secrets in a vault and rotate them.
  • An SBOM tells you which components you ship, so you can act quickly when one has a known vulnerability. CERT-In has published SBOM guidelines.
  • Your vendors' APIs and code are in scope too: section 8(1) keeps you responsible for your processors.

Most products today are a set of APIs with a mobile app or a web front end on top. Those APIs carry the personal data: names, phone numbers, addresses, orders, health reports, payment references. When they fail, they tend to fail quietly. Nothing crashes. The API simply returns data to someone who should not have it, and you find out from a customer, a researcher or a log review months later.

This page explains where API and software supply chain risks come from, how they map to the DPDP Act and Rules, and how our API security engagement runs. We are an engineering, security and privacy team. We work alongside your legal counsel, who advise on legal questions such as breach notice.

Why do APIs leak personal data?

The OWASP API Security Top 10 (2023 edition), a widely used open reference, puts broken object level authorisation first (API1:2023). It also lists broken authentication (API2), broken object property level authorisation (API3), broken function level authorisation (API5), security misconfiguration (API8), improper inventory management (API9) and unsafe consumption of APIs (API10). In plain terms, the repeated patterns are:

  • No ownership check. The API trusts the record ID in the request and does not confirm it belongs to the caller.
  • Too much in the response. The API returns the full database object and leaves the app to hide fields, so date of birth, address or internal notes travel to every phone.
  • Admin functions open to ordinary users. An endpoint meant for staff works for any logged-in user who finds it.
  • Forgotten APIs. An old version, a partner integration or a test server still runs, still holds real data, and has none of the newer controls.
  • Leaked secrets. A cloud key, database password or third-party token is committed to a repository, pasted in a ticket or printed in a build log.
  • Compromised or outdated components. A library or base image you build on has a known vulnerability, or a malicious version enters your build.

CERT-In's Technical Guidelines on SBOM, QBOM and CBOM, AIBOM and HBOM (Version 2.0, dated 9 July 2025) name the same supply chain threats: malicious code inserted by attackers, vulnerabilities in outdated components, and breaches through compromised suppliers.

What does DPDP require of API and supply chain security?

The DPDP Act does not mention APIs, SBOMs or pipelines. It sets outcomes. Section 8(5) requires a Data Fiduciary to take reasonable security safeguards to prevent a personal data breach. Rule 6 of the DPDP Rules, 2025 sets the minimum measures, with examples introduced by “such as”. Both apply from 13 May 2027. The table shows how the Rule 6 measures translate into API and supply chain controls. The full control set is in our security safeguards guide.

Rule 6 measureWhat it means for APIs and code
Encryption, obfuscation, masking or virtual tokensTLS on every API, including internal service-to-service calls; tokens instead of raw identifiers in URLs; masked fields in responses that do not need the full value
Access control over computer resourcesStrong authentication on every endpoint; an ownership check on every record; least privilege for service accounts, pipeline credentials and API keys
Visibility through logs, monitoring and reviewApplication-level logs of which caller read which record; alerts on enumeration patterns, such as one account reading thousands of IDs
Keeping logs for one yearRetention of at least one year on API gateway and application logs, with identifiers tokenised rather than repeated
Safeguards in processor contractsSecurity terms for vendors whose APIs or code handle your personal data: testing, vulnerability fixing, breach notice to you
Measures to make sure safeguards are observedSecure development practice, security checks in CI/CD, an SBOM and a vulnerability management process with owners and timelines

Failing to take reasonable security safeguards can attract a penalty of up to ₹250 crore under the Schedule to the Act. The Board decides the amount after an inquiry, weighing factors in section 33(2) such as the gravity and duration of the breach and whether you took timely steps to mitigate it.

₹250 croremaximum penalty for failing to take reasonable security safeguards
72 hfor the detailed breach report to the Board under Rule 7
1 yearlog retention under Rule 6

What is broken object level authorisation, and how do you fix it?

Broken object level authorisation (BOLA) happens when an API takes an object identifier from the caller, such as /orders/48213, and returns that object without checking that the caller is allowed to see it. Authentication is not enough: the caller is logged in, just not as the owner. Changing 48213 to 48214 returns a stranger's order, address and phone number.

The fix is a design rule, not a patch on one endpoint:

  • Every handler that reads or changes a record checks ownership or permission on the server, using the identity from the session or token, never from a field the caller sends.
  • The check lives in one shared layer that every endpoint uses, so a new endpoint cannot ship without it.
  • Responses are built from an explicit list of fields for that caller, not by returning the whole object.
  • Tests try each endpoint with a second user's identifiers, and the pipeline fails if any of them returns data.
  • Monitoring flags a single account or key reading many records in sequence.

How does an API security engagement run?

We follow five steps. Each one produces evidence you can keep in your Rule 6 file. All testing happens only on systems you own or are authorised to test, under written authorisation that sets scope, timing and contacts.

How we secure your APIs and software supply chainDiscover to pipeline
01Discover

Every API, including forgotten ones

02Authenticate

Check who, and whose record, every time

03Protect secrets

A vault, rotation, no keys in code

04Know your components

SBOM and vulnerability scanning

05Secure the pipeline

Checks in CI/CD, signed builds

Now:

1. Discover: every API, including forgotten ones

We build an inventory from your gateway and load balancer configuration, DNS records, cloud accounts, mobile app traffic, API specifications and code repositories. Each API is tagged with its owner, the personal data it carries, who calls it and whether it is still needed. Old versions and test servers holding real data are usually the first findings. Retiring an API is often cheaper than securing it.

2. Authenticate: strong auth, checks on every record, least privilege

We review how each API authenticates callers and how it decides what they may see. We test for broken object level, property level and function level authorisation using test accounts you provide. Service accounts and partner keys are cut back to the access they need. Where fixes are needed, our engineers work with yours on the shared authorisation layer rather than one endpoint at a time.

3. Protect secrets: vault and rotation, no keys in code

We scan repositories, including their history, along with build logs, container images and configuration for exposed keys and passwords. Exposed secrets are rotated, not just deleted, because a copy may already exist elsewhere. We help you set up secrets management: a vault, one credential per service, short lifetimes where the platform allows, rotation on a schedule, and access to the vault logged.

4. Know your components: SBOM and vulnerability scanning

We generate a software bill of materials for each application and container image: the libraries, versions, suppliers and licences it contains. CERT-In's guidelines list minimum SBOM data fields such as component name, version, supplier, licence, dependencies, vulnerabilities, patch status and end-of-life date. The SBOM feeds a vulnerability management process: scanning against known vulnerabilities, a fix timeline by severity, an owner for each finding and a record of what was fixed when.

5. Secure the pipeline: checks in CI/CD, signed builds

CI/CD security keeps the gains from slipping. We add checks to your build and release pipeline: secret scanning, dependency and image scanning, the authorisation tests from step 2, and a gate that blocks a release with critical findings. Pipeline credentials get least privilege, builds run from reviewed code, and release artefacts are signed so you can show what was deployed and where it came from.

Is an API data leak a reportable breach under DPDP?

Often, yes. Section 2(u) defines a personal data breach to include unauthorised processing and accidental disclosure, acquisition or sharing that compromises confidentiality. An API that served one person's record to another fits that description. Section 8(6) requires every personal data breach to be intimated to the Board and to each affected person, with no materiality threshold. Under Rule 7, the Board gets an initial intimation without delay and a detailed report within 72 hours of you becoming aware. CERT-In's separate 6-hour reporting direction (April 2022) continues to apply in parallel for reportable cyber incidents. Our breach notification guide covers both.

Logs decide what you can say

When a flaw is found, the first question is whether anyone used it, and which records they read. Without application-level access logs, you may not be able to answer, and may have to treat every record the API could reach as exposed. Whether a flaw found and fixed, with no evidence of misuse, needs notice is a judgement to make with your legal counsel. Logs give them facts to work with.

Where do vendors and processors fit?

Section 8(1) keeps you responsible for processing done on your behalf by a Data Processor, despite any agreement to the contrary. Section 8(2) allows you to engage a processor only under a valid contract, and Rule 6 asks for security safeguards to be written into that contract. Your payment gateway, messaging provider, CRM and logistics partner all expose or consume APIs that carry your customers' data. The libraries and services your developers pull in are part of the same chain. The roles guide on fiduciaries and processors explains who sits where.

For processors, we help you set out what to ask for: how they test their APIs, how they manage secrets and vulnerabilities, whether they can provide an SBOM, and how quickly they will tell you about a breach. For software you buy, asking for an SBOM at procurement is in line with CERT-In's recommendation for government, public sector and essential services organisations, and a sensible practice for others. If you run a platform, our DPDP for SaaS guide covers what your own customers are likely to ask you.

What do you get from the engagement?

DeliverableWhat it containsHow you use it
API inventoryEvery API and version, owner, personal data carried, callers, status (keep, fix, retire)Scope for Rule 6 controls; a list to keep current as APIs change
Authorisation test reportFindings by endpoint and severity, with reproduction steps and fix guidanceEngineering backlog; evidence of access control testing
Secrets review and rotation recordExposed secrets found, rotation done, vault design and access policyEvidence that exposed credentials were dealt with
SBOM and vulnerability registerSBOM per application and image; open vulnerabilities with owners and target datesOngoing vulnerability management; answers to customer and auditor questions
CI/CD security baselinePipeline checks, release gates, credential scopes, build signingKeeps new releases from reopening fixed gaps
Processor question setAPI and supply chain questions and contract points for vendorsVendor reviews and contract updates with your counsel

We aim to leave your team running these controls, not depending on us. A typical engagement starts with discovery and authorisation testing on the APIs that carry the most sensitive data, then extends to secrets, SBOM and the pipeline. Timelines depend on how many applications and teams are in scope. For the wider programme, see our DPDP privacy engineering service, or ransomware readiness for recovery.

How to start

  1. Pick a first scope. The customer-facing APIs that carry the most sensitive personal data, plus the pipeline that deploys them.
  2. Gather what exists. API specifications, gateway configuration, repository access and any earlier test reports.
  3. Agree authorisation. A written scope, test accounts, testing windows and an escalation contact.
  4. Run the five steps. Fix the highest-risk findings as they come, and file the evidence against Rule 6.
  5. Keep it running. Pipeline checks and the vulnerability register carry on after the engagement ends.

API security is one of the engineering services that sit alongside a DPDP programme. If you would like our engineers to start with your most exposed APIs, get in touch.

Frequently asked questions

What is broken object level authorisation (BOLA)?

It is when an API accepts an identifier from the caller, such as an order or patient ID, and returns that record without checking that the caller is allowed to see it. Changing the number in a request then returns someone else's data. OWASP lists it as API1 in its API Security Top 10 (2023).

Does the DPDP Act cover API security?

The Act does not mention APIs by name. Section 8(5) requires reasonable security safeguards to prevent a personal data breach, and Rule 6 sets minimum measures such as access control, logging and monitoring. An API that serves personal data is one of the systems those safeguards must cover from 13 May 2027.

Is an API data leak a personal data breach under DPDP?

If personal data was disclosed to someone who should not have it, it fits the Act's definition of a personal data breach in section 2(u). Section 8(6) requires every breach to be intimated to the Board and affected people, with no materiality threshold. Whether a flaw that was found and fixed, with logs showing no misuse, needs notice is a judgement to make with your legal counsel.

Is SBOM mandatory in India?

CERT-In's Technical Guidelines on SBOM, QBOM and CBOM, AIBOM and HBOM (Version 2.0, dated 9 July 2025) recommend that government, public sector and essential services organisations include SBOM requirements in their software procurement. They are addressed especially to those sectors and to the software export and services industry. The DPDP Act does not require an SBOM, but one helps you show vulnerability management under Rule 6.

How do you manage secrets securely in CI/CD?

Keep API keys, database passwords and tokens in a secrets vault, not in code, config files or pipeline variables visible to everyone. Give each service its own short-lived credential with the least access it needs, rotate on a schedule and immediately after any exposure, and scan repositories and build logs for leaked keys.

Do you test APIs without permission?

No. We test only systems you own or are authorised to test, under written authorisation that sets scope, timing and contacts. For APIs run by your vendors, we work through their own testing process or ask for their reports.

Turn this guide into a working programme

A 30-minute scoping call maps your gaps against the Rules and the order to close them. We aim to send a proposal, usually at a fixed fee, within three working days.

Book a scoping call

Related guides

This guide explains the Digital Personal Data Protection Act, 2023 and the DPDP Rules, 2025 as notified on 13 November 2025. It is general information, not legal advice. Check the official text, and your counsel, before relying on it.

Book a scoping call