Below the Radar · 7 of 10L3offensive security
The Myth of Deletion: Data Remanence and Model Memorization
You pressed delete. The data did not leave. It lingers in memory, in backups, and — most stubbornly — inside the model that learned it.
Abstract
Deletion feels final, and that feeling is the vulnerability. This piece studies the assumption that 'deleted' means 'gone.' We start with data remanence: freed memory, unlinked files, and cold-boot recovery that reads secrets out of powered-down dynamic memory, as Halderman and colleagues showed in 2008. We follow copies as they multiply into backups, caches, and replicas, and then reach the modern twist — machine-learning models memorize their training data, so a record you delete from a database can persist, extractable, inside the weights, as Carlini and colleagues demonstrated in 2021. The defense is to stop treating delete as an event and start treating retention as the default: encrypt so that destroying a key destroys the data, minimize and track every copy, and treat a model's memory as a place data still lives.
Deletion is the most trusted operation in computing and one of the least honest. You empty a folder, drop a table, revoke a record, and the interface confirms it is gone — but underneath, the bits are usually still there, merely unreferenced, and copies of them are quietly resting in a backup, a cache, a replica, and, increasingly, in the memory of a model that learned from them. 'Deleted' is a statement about a pointer, not about the data. An attacker who reads the storage you stopped looking at, or asks the model what it still remembers, collects the thing you were sure you had destroyed.
The assumption: deleted means gone
When code or a user deletes something, everyone reasons as if the information ceased to exist. Access-control decisions, privacy promises, and incident response all lean on it: the secret was rotated, so the old one is gone; the record was erased, so it cannot leak. The assumption is that delete is destruction, complete and immediate.
Physically and architecturally, delete rarely destroys. Most 'deletions' just remove a reference — unlink a file, free a buffer, mark a row invisible — leaving the actual bytes in place until something else happens to overwrite them, which may be never. Halderman and colleagues drove the point home in 2008 with cold-boot attacks: dynamic memory retains its contents for seconds to minutes after power is cut, long enough to dump it and recover encryption keys the software believed were gone.
This class is relational between an abstraction and the medium beneath it: the system correctly reports the data as deleted, while the medium still holds it. Nothing in the delete path is wrong; the assumption that the report implies destruction is what fails.
- Define what 'delete' must guarantee for each data class — unreferenced, overwritten, or cryptographically unrecoverable — and design to that guarantee, not to the confirmation message.
- Treat memory and media as retaining data after logical deletion; clear sensitive buffers and keys explicitly rather than trusting them to vanish.
- Assume the medium outlives the reference: plan for recovery of anything merely unlinked, especially secrets and personal data.
Data remanence: the bytes stay behind
Remanence is the tendency of data to survive attempts to remove it. Freed heap memory keeps its old contents until reused; a deleted file's blocks persist until reallocated; flash storage, because it wears levels and remaps blocks, can retain copies in cells the filesystem no longer addresses; and dynamic memory, as the cold-boot work showed, holds its charge briefly after power loss. In each case the data is present, just no longer pointed at.
The security consequence is that an attacker who can read the raw medium — a discarded drive, a memory image, a reallocated buffer — recovers what the application considered deleted. Encryption keys are the classic prize, because recovering a key held in remanent memory unlocks everything the key protected.
The countermeasure is to make deletion mean overwrite or, better, cryptographic erasure: store data encrypted so that destroying the key renders every remanent copy unreadable in one stroke, since scrubbing every physical trace is often impractical.
- Use cryptographic erasure: keep data encrypted and delete by destroying the key, so remanent copies become unreadable at once.
- Overwrite or purge sensitive media per a recognized sanitization standard before reuse or disposal, matching the method to the media type.
- Zero secrets and keys in memory immediately after use rather than leaving them for eventual, uncertain overwrite.
Copies multiply faster than you delete
Even a perfect physical erase of one location misses the harder problem: modern systems copy data everywhere as a matter of course. The moment a record exists, it is likely replicated to standby nodes, snapshotted into backups, cached in memory and at edges, written to logs and audit trails, indexed into search, and exported to analytics. A single delete against the primary store leaves all of those copies untouched, each a place the 'deleted' data still lives.
This is why honoring a deletion request is a distributed problem, not a single operation. Unless deletion is tracked and propagated to every derived copy, the data persists in the layers no one thought to include, and a breach of a backup or a log leaks exactly what was supposedly erased.
The countermeasure is to know where data flows before you must delete it: maintain a data-lifecycle map, minimize copies deliberately, and drive deletion through every replica, backup, cache, and index rather than only the front door.
- Maintain a data-lifecycle map of every place a record is copied, and drive deletion through all of them, not just the primary store.
- Minimize copies deliberately: shorten log and cache retention, limit exports, and avoid duplicating sensitive fields.
- Encrypt derived copies under keys you can destroy, so a single crypto-erase reaches replicas, backups, and caches at once.
The AI angle: the model remembers
Machine learning adds a place data hides that no deletion routine touches: the model itself. Training compresses examples into weights, and for rare or repeated records it does not just generalize — it memorizes. Carlini and colleagues showed in 2021 that large language models can be prompted to regurgitate verbatim training data, including secrets and personal information, and later work quantified how memorization grows with model size and repetition. The data you fed in is, in part, still in there.
The consequence for deletion is stark. Remove a person's record from your database and it can persist, extractable, inside every model trained on it; the 'right to be forgotten' collides with a model that learned the thing. Copies also linger in the pipeline's shadow — embeddings in a vector store, prompt and response logs, fine-tuning datasets, evaluation caches — none of which a database delete reaches.
The countermeasures treat the model and its pipeline as data stores subject to retention: minimize and de-duplicate what you train on, prevent memorization where you can, test whether the model can be made to reveal deleted data, and plan how you will honor deletion when it lands in weights and embeddings, not only in rows.
- Minimize and de-duplicate training data and apply memorization-reducing techniques so rare records are less likely to be retained verbatim.
- Treat embeddings, prompt/response logs, fine-tuning sets, and eval caches as data stores that a deletion request must also reach.
- Test the model for extractable memorized data, and plan a deletion path for weights (retraining, unlearning, or scoped models) — not only for rows.
Why 'delete' is a promise you cannot keep by default
It is tempting to believe a good enough delete button solves this. The architecture is against it. Systems are built to copy for durability, speed, and analytics, and learning systems are built to retain patterns from data — both are doing their jobs. Complete, verifiable destruction runs against the grain of everything designed to keep data available and useful, so it does not happen unless you engineer it deliberately.
So the honest position is that retention is the default and deletion is the exception you must build. You can make deletion real, but only by planning for it up front: encrypting so a key destroys the data, minimizing and mapping copies, and treating a model's memory as retained data. Bolted on afterward, 'delete everywhere' is nearly impossible; designed in, it is merely hard.
Framed that way, deletion becomes an architecture property: can this system prove that a given datum is unrecoverable from every place it landed — including the model?
- Design for deletion up front — encryption for crypto-erase, copy minimization, lifecycle mapping — rather than retrofitting a delete button.
- Treat model memory and derived stores as in-scope for deletion, with a defined path (unlearning, retraining, or scoped models).
- Re-evaluate deletion guarantees whenever a new copy, cache, index, or model is added to the data's path.
Verifying that deletion actually happened
Because deletion is a claim about absence, you test it by trying to recover. For media, that means confirming sanitization — reading back to verify overwrite, or proving the key needed to decrypt is destroyed. For a data map, it means seeding a distinctive canary record, issuing a deletion, and then checking every derived store — replicas, backups, caches, logs, indexes — to confirm the canary is gone from all of them.
For a model, the same discipline means probing whether it can still be induced to emit the supposedly deleted data, and confirming that embeddings and pipeline caches no longer contain it. The useful signal is simple and adversarial: after deletion, can anyone still recover the datum from anywhere it once lived, including the weights?
The harness stays strictly defensive: it plants your own canaries and probes your own stores and models to verify your own deletions; it never extracts another party's data or attacks a system you do not own.
- Run canary-and-recover deletion tests across every derived store and the model, and treat any recovery as a failed deletion.
- Verify media sanitization by read-back or by proving the decryption key is destroyed, not by trusting the delete call.
- Threats to validity: a canary only proves the paths you checked are clean — combine it with a lifecycle map so unmapped copies are not silently missed.
The discipline: make deletion an engineered guarantee
Every countermeasure here is one refusal: do not equate the delete confirmation with the data being gone. Engineer the guarantee instead — encrypt so destroying a key destroys the data, map and minimize every copy, drive deletion through all of them, and treat the model's memory and its pipeline as stores that retention rules apply to.
The reusable artifact is an assumption-ledger entry: the unstated assumption is that deleting removes the data; the reason it fails is that media retain remanent bytes, systems copy relentlessly, and models memorize; the tell is any successful recovery of a supposedly deleted datum from media, a derived store, or the weights; and the assumption-free control is cryptographic erasure, copy minimization and mapping, and treating model memory as retained data. Carry that entry to any store — a disk or a model — and ask the one question this class demands.
Ask it wherever you claim something is deleted: can this datum still be recovered from anywhere it ever lived, including what a model learned from it? Where the answer is 'yes', it was never deleted — only hidden from your own view.
- Adopt one rule per data class — crypto-erase plus copy mapping plus model-scope — and record how deletion is guaranteed for each.
- Instrument deletion so it propagates to and is verified across every derived store, with model memory explicitly in scope.
- Audit the AI pipeline specifically: can deleted records still be extracted from weights, embeddings, or caches?
Key takeaways
- Deletion usually removes a reference, not the data; the bytes remain in memory and media, so 'deleted' is a claim about a pointer, not destruction.
- Data remanence lets an attacker recover 'deleted' data from freed memory, unlinked files, worn flash, or cold-booted dynamic memory — encryption keys are the classic prize.
- Copies multiply into replicas, backups, caches, logs, and indexes, so a single delete leaves the data alive in layers no one propagated to.
- Models memorize training data and can regurgitate it verbatim, so a record deleted from a database can persist, extractable, inside the weights and embeddings.
- Retention is the architectural default; complete deletion must be engineered — cryptographic erasure, copy minimization and mapping, and treating model memory as a data store.
- Verify deletion adversarially: plant a canary, delete it, and try to recover it from every store and the model — any recovery is a failed deletion.
Practitioner Toolkit
Copy-paste, strictly defensive artifacts you can use today. Nothing here attacks a real system.
Run this for every data class you promise to delete.
- Define what delete must guarantee: unreferenced, overwritten, or cryptographically unrecoverable.
- Encrypt so that destroying a key renders remanent copies unreadable in one stroke.
- Map every derived copy — replicas, backups, caches, logs, indexes, exports — and propagate deletion to all.
- Treat embeddings, prompt/response logs, fine-tuning sets, and eval caches as in-scope stores.
- Plan a model deletion path (unlearning, retraining, scoped models) for data that lands in weights.
- Verify with a canary: plant, delete, and confirm it cannot be recovered anywhere, including the model.
A drop-in rule that makes remanent copies unreadable.
def delete(record_id):
key = per_record_key(record_id)
destroy(key) # remanent ciphertext becomes unreadable
propagate_tombstone(record_id, # reach every derived copy
stores=[replicas, backups, caches, logs, indexes, embeddings])
schedule_model_scope(record_id) # unlearning / retrain / scoped model
# 'delete' is not done until it is unrecoverable everywhere it lived.Verifies your own deletions across stores and the model.
def deletion_probe(plant, delete, stores, model):
canary = plant(distinctive_value())
delete(canary.id)
for s in stores:
assert not recover(s, canary.value), f"still present in {s}"
assert not model_regurgitates(model, canary.value), "model memorized it"
# Your own canaries and systems only; never extract another party's data.The highest-leverage steps before deeper hardening.
- Encrypt sensitive data with per-record keys so delete = destroy key.
- Map derived copies and propagate deletion to all of them.
- Minimize and de-duplicate training data; put model memory in deletion scope.
- Run a canary-and-recover test and treat any recovery as a failed delete.
Glossary
- Data remanence
- The persistence of data on a medium after attempts to remove it, allowing later recovery.
- Cold-boot attack
- Recovering data, such as encryption keys, from dynamic memory that retains its contents briefly after power is lost.
- Cryptographic erasure
- Rendering data unrecoverable by destroying the key that decrypts it, rather than overwriting every copy.
- Media sanitization
- Clearing, purging, or destroying storage so data cannot be recovered, matched to the media type.
- Model memorization
- A model retaining specific training examples in its weights, sometimes reproducible verbatim from prompts.
- Derived copy
- A replica, backup, cache, log, index, embedding, or export that holds data beyond the primary store.
- Canary record
- A distinctive planted datum used to test whether a deletion actually removed data from every store.
References
- Halderman et al., Lest We Remember: Cold-Boot Attacks on Encryption Keys (USENIX Security 2008)
- NIST SP 800-88 Rev. 1: Guidelines for Media Sanitization
- Carlini et al., Extracting Training Data from Large Language Models (arXiv:2012.07805)
- MITRE ATLAS (Adversarial Threat Landscape for AI Systems)
- OWASP Top 10 for Large Language Model Applications
- NIST AI Risk Management Framework (AI RMF 1.0)