Safeguard
Application Security•

ASVS 5.0 V11.7.2: Minimise Data Exposure During Processing

ASVS V11.7.2 asks you to expose the least data possible while processing and to encrypt it again as soon as you can. Patterns for shrinking plaintext lifetime.

Safeguard Security Team
2 min read

ASVS 5.0 V11.7.2 (Level 3) requires data minimization during processing: expose only the minimum data needed, and encrypt it again immediately after use or as soon as feasible.

Why it matters

Every plaintext copy is a target. Long lived plaintext in memory, caches, logs and temporary files widens the window in which a bug, a core dump or an insider can reach it.

How to implement it

Shrink what you decrypt and how long you hold it.

  1. Decrypt one field, not the whole record.
  2. Pass tokens or references between services instead of raw values.
  3. Keep plaintext in a short scope and clear it after use.
  4. Keep it out of logs, caches and error reports.
def with_card(vault, token, fn):
    pan = vault.reveal(token)      # decrypt only here
    try:
        return fn(pan)
    finally:
        pan = None                 # drop the reference promptly

Language runtimes do not guarantee wiping memory, so combine this with minimising scope, and with memory protection from V11.7.1 for the most sensitive cases.

How to test it

Trace a sensitive field through one request. List each place it is plaintext, and for how long. Check logs and crash dumps for the value. Fewer places and shorter spans on the next review means progress.

Common mistakes

  • Decrypting a full database row to read one column
  • Caching decrypted values for speed
  • Logging request bodies that contain secrets

Quick check

What two ideas does V11.7.2 combine?

Expose minimal data while processing, and re encrypt as soon as feasible.

Sources

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.