Join our Newsletter — 33% off our NHI Course
Home› Glossary› Cyber Security› Database Record Leakage
Cyber Security

Database Record Leakage

← Back to Glossary
By NHI Mgmt Group Updated November 25, 2026 Domain: Cyber Security

Database record leakage is the unintended exposure of individual rows or records from a database to people, services, or systems that should not see them. It usually happens through broken access controls, insecure queries, misconfigured application logic, or overbroad API responses that return more data than authorised.

What Database Record Leakage Means in Practice

Database record leakage is not usually a single bug, but a failure of data boundaries. It happens when an application, API, query layer, or backend service returns rows that should have been filtered out, turning a normal database read into an unauthorised disclosure of sensitive records.

The security problem is that record-level exposure can look like a successful request from the application’s point of view. If the access check happens too late, or only at the page or endpoint level, the database may still return data that crosses tenant, user, role, or object boundaries.

How Record Leakage Happens

The most common mechanism is broken authorisation. A query may be syntactically valid and fast, but still lack a row-level predicate tied to the caller’s identity, tenant, or scope. In other cases, insecure query construction, ORM misuse, or “helpful” API expansion can expose related tables or fields that were never intended to be returned.

Misconfiguration also matters. Shared databases, weak default permissions, overly broad service roles, and development shortcuts can all create a path where one request or one compromised component can see far more records than intended. NHIMG’s Firebase misconfiguration exposure 2024 is a clear example of how missing access rules can turn ordinary storage into mass exposure.

Why Leakage Is Dangerous

Record leakage is dangerous because a single successful request can expose many victims at once. Even when the application appears “authenticated,” the actual failure is often in the trust boundary between the caller and the specific rows being returned, which can produce cross-tenant disclosure, privacy harm, fraud exposure, or a wider incident if the leaked records include passwords, tokens, or recovery data.

Leakage often scales silently. A system may pass functional tests, yet still expose records through alternate filters, search endpoints, export functions, debug views, bulk downloads, or API fields that were not reviewed with the same care as the primary UI path. NHIMG’s MongoBleed breach shows how database misconfiguration can expose secrets at scale rather than as an isolated mistake.

Exposure, Detection, and Containment

Organisations should treat record leakage as both a data exposure and an access control problem. The first question is not just whether the database exists, but whether the exposed path can return records outside the intended subject, tenant, or role. That means checking inventory, externally reachable services, API response shapes, query filters, and any shared data paths that bypass application logic.

Detection usually depends on reviewing unusual query patterns, unexpected high-volume reads, access to broad endpoints, and responses that contain more rows or fields than normal. When a leakage path is found, containment should focus on closing the access path, verifying whether sensitive fields were returned, and checking whether related secrets, sessions, or dependent credentials must be rotated. For incident response involving retrieval-backed leakage, NHIMG’s If your vector database is compromised gives a practical containment model for exposure review, key rotation, and rebuilding trusted data sources.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

OWASP API Security Top 10 addresses the attack surface, NIST SP 800-53 Rev 5 and CIS Controls v8 set the technical controls, and ISO/IEC 27001:2022 defines the regulatory obligations.

FrameworkControl / ReferenceRelevance
OWASP API Security Top 10API1 — Broken Object Level AuthorizationRecord leakage often results from per-object access checks failing at the API layer.
Recommendation — Enforce per-record access checks so API responses never return objects outside the caller's scope.
NIST SP 800-53 Rev 5AC-3 — Access EnforcementRow-level disclosure is an access enforcement failure over stored data.
AC-6 — Least PrivilegeOverbroad queries and service roles expose more records than a process needs.
Recommendation — Apply AC-3 to enforce record-level authorization before any row is released. Limit data and query privileges so services can only retrieve the records required for their function.
CIS Controls v8CIS-6 — Access Control ManagementRecord leakage is prevented by tightly governing who can access which data and services.
Recommendation — Use CIS-6 to review and restrict data access paths that can expose unauthorized records.
ISO/IEC 27001:2022A.8.3 — Information access restrictionThe term concerns restricting access to records so only authorised readers can see them.
Recommendation — Implement information access restrictions so databases and apps only reveal authorized records.

Practitioner Guidance

Why practitioners should care: Record leakage is often missed because the request itself is valid, which makes it easy to under-treat as a simple bug rather than a data exposure event. The right mental model is “who can see which rows,” not just “who can reach the endpoint.”

What to watch for: Pay special attention to export jobs, search APIs, bulk list endpoints, admin views, and fallback logic that may return richer records than the primary path. NHIMG’s RAG Security Test Plan Template is useful here because it treats retrieval authorisation and leakage as explicit test cases, not assumptions.

Practitioner takeaway: If the database can return records that the application never intended to expose, the control failure is already present, even if the interface still “works.”

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on November 25, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org