Join our Newsletter — 33% off our NHI Course
Home› Glossary› Cyber Security› Unbounded Cache
Cyber Security

Unbounded Cache

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

An unbounded cache is a cache with no fixed limit on the number of entries or total memory it can consume. Without size limits, eviction policy or time-to-live controls, it can keep growing until it exhausts memory, slows the system, or causes a denial of service.

What an unbounded cache is doing under the hood

An unbounded cache stores entries without a hard cap on item count or memory usage. That makes it convenient in the short term, but it also means cache growth is driven only by workload shape, not by a deliberate resource ceiling. In practice, the cache becomes a shared consumer of memory, CPU and allocation overhead.

The key operational difference is that a bounded cache has an explicit pressure relief mechanism, while an unbounded one relies on the rest of the system to absorb growth. That can be acceptable in narrow, predictable workloads, but it is fragile when traffic spikes, keys are high-cardinality, or cached objects are larger than expected.

Why unbounded caches become dangerous

The danger is not the cache itself, but the absence of a stopping point. If entries are never evicted and do not expire, stale or rarely used data can accumulate indefinitely. Over time, the cache can crowd out other heap allocations, trigger garbage-collection pressure, and cause latency collapse long before the process actually runs out of memory.

This failure mode is especially severe in shared services, where a single hot code path can gradually turn memory growth into a system-wide availability problem. The effect may look like a slow degradation at first, then escalate into allocator churn, paging, process termination or a full denial of service.

Common failure patterns and control gaps

Unbounded caches usually fail because a design assumption was left implicit: that the key space would stay small, that the data would be short lived, or that upstream callers would be disciplined. Those assumptions often break when user input expands the cache key space, when per-request metadata is cached too eagerly, or when the same cache is reused across features with different lifecycles.

Another common gap is confusing cache utility with cache safety. A cache can improve performance and still be operationally unsafe if it has no size limit, no TTL, no eviction policy, and no monitoring for hit rate, resident set growth or entry cardinality. Without those controls, the cache may silently become a memory sink.

How to think about unbounded cache design

An unbounded cache should be treated as an explicit trade-off, not a default pattern. The right question is not whether caching is beneficial, but whether the working set is predictable enough that growth can be trusted to remain naturally constrained. When it cannot, the design should include at least one enforced bound, usually memory, entry count, time, or a combination of all three.

Good cache design also distinguishes between correctness and convenience. A cache that improves read performance but can destabilise the host is not a safe optimisation for general-purpose services. In performance-sensitive systems, the safer pattern is usually a bounded cache with predictable eviction behaviour and observability around saturation.

Risk and Threat Considerations

Unbounded caches create a material availability risk because they turn ordinary request patterns into ungoverned resource growth. In an exposed service, an attacker does not need to “break” the cache to make it harmful, they may only need to drive enough unique keys or large objects through the code path to exhaust memory.

Failure mechanism: Repeated insertion without bounds increases memory consumption until the process slows, thrashes or fails, and that can be amplified by high-cardinality inputs, large objects or cache reuse across requests.

Impact: The usual outcomes are latency spikes, degraded throughput, process crashes and denial of service, with the failure sometimes spreading to neighbouring components that depend on the same host, runtime or cluster capacity.

Standards & Framework Alignment

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

NIST CSF 2.0, NIST SP 800-53 Rev 5 and CIS Controls v8 set the technical controls, while ISO/IEC 27001:2022 defines the regulatory obligations.

FrameworkControl / ReferenceRelevance
NIST CSF 2.0PR.PS-04 — Platform Reliability and AvailabilityUnbounded caches affect runtime stability and service availability.
Recommendation — Set resource limits that preserve service availability under abnormal cache growth.
NIST SP 800-53 Rev 5SI-13 — Predictable Failure PreventionThe cache must fail safely before resource exhaustion becomes a denial of service.
Recommendation — Add enforced bounds so cache growth cannot exhaust system resources.
CIS Controls v8CIS-4 — Secure Configuration of Enterprise Assets and SoftwareCache limits and eviction settings are part of secure and stable software configuration.
Recommendation — Configure cache caps, TTLs and eviction settings as standard hardening.
ISO/IEC 27001:2022A.8.6 — Capacity managementUnbounded caches are a capacity-management concern because they can consume memory unpredictably.
Recommendation — Monitor and control cache capacity so resource growth stays within acceptable limits.

Practitioner Guidance

What to watch for: Track cache size, entry growth, eviction behaviour and memory headroom together, not as separate metrics. A cache that appears efficient by hit rate can still be unsafe if its population grows without a clear upper limit.

Governance implication: Treat cache bounds as part of service ownership, not as an optional optimisation detail. If a cache is allowed to grow freely, the service owner should be able to explain why the workload is inherently self-limiting and what prevents unbounded memory growth.

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