VariantDraft

CWE-591Sensitive Data Storage in Improperly Locked Memory

Category: data-exposure

Description

The product stores sensitive data in memory that is not locked, or that has been incorrectly locked, which might cause the memory to be written to swap files on disk by the virtual memory manager. This can make the data more accessible to external actors. On Windows systems the VirtualLock function can lock a page of memory to ensure that it will remain present in memory and not be swapped to disk. However, on older versions of Windows, such as 95, 98, or Me, the VirtualLock() function is only a stub and provides no protection. On POSIX systems the mlock() call ensures that a page will stay resident in memory but does not guarantee that the page will not appear in the swap. Therefore, it is unsuitable for use as a protection mechanism for sensitive data. Some platforms, in particular Linux, do make the guarantee that the page will not be swapped, but this is non-standard and is not portable. Calls to mlock() also require supervisor privilege. Return values for both of these calls must be checked to ensure that the lock operation was actually successful.

Common consequences· 1

  • Confidentiality — Read Application Data, Read Memory
    Sensitive data that is written to a swap file may be exposed.

Potential mitigations· 2

  • [Architecture and Design]Identify data that needs to be protected from swapping and choose platform-appropriate protection mechanisms.
  • [Implementation]Check return values to ensure locking operations are successful.

References

  1. https://cwe.mitre.org/data/definitions/591.html

(incoming)9

TypeTargetConfidenceTier
VulnerabilityCVE-2025-21224cve-2025-212240%live
VulnerabilityCVE-2025-21294cve-2025-212940%live
VulnerabilityCVE-2025-21309cve-2025-213090%live
VulnerabilityCVE-2025-24035cve-2025-240350%live
VulnerabilityCVE-2025-24045cve-2025-240450%live
VulnerabilityCVE-2025-26671cve-2025-266710%live
VulnerabilityCVE-2025-27482cve-2025-274820%live
KEVEntryMicrosoft Windows CNG Key Isolation Service Privilege Escalation Vulnerabilitykev-cve-2023-282290%live
KEVEntryMicrosoft Windows Kernel Privilege Escalation Vulnerabilitykev-cve-2024-381060%live

Related by meaning· 6

Nearest entities by semantic similarity across the cs-graph corpus.

CWE
Improper Resource Locking
CWE
Cleartext Storage of Sensitive Information in Memory
CWE
Free of Memory not on the Heap
CWE
Insecure Storage of Sensitive Information
CWE
Missing Lock Check
CWE
Cleartext Storage in a File or on Disk
Sourced from MITRE CWE 4.20. Curated for EU compliance use cases by Adam Lundqvist, Founder at SQUR.