CWE-1342 Base Incomplet

Information Exposure through Microarchitectural State after Transient Execution

This vulnerability occurs when a CPU fails to completely erase temporary data traces left behind by speculative execution or error recovery processes. These lingering microarchitectural hints can be…

Définition

What is CWE-1342?

This vulnerability occurs when a CPU fails to completely erase temporary data traces left behind by speculative execution or error recovery processes. These lingering microarchitectural hints can be analyzed through side-channels to leak sensitive information.
Modern CPUs use techniques like speculative execution and microcode assists to boost performance. When these operations are canceled or encounter errors, the processor should fully clean up. However, if remnants of these transient computations persist in internal buffers (like load/store queues), they create a measurable change in the chip's hidden state. An attacker can then use timing or other side-channel attacks to infer protected data, such as secrets from other processes or virtual machines. Successful exploitation typically requires three conditions: first, vulnerable code must speculatively access sensitive information, leaving microarchitectural traces. Second, the attacker must be able to trigger the specific CPU exceptions or mis-speculations that create these traces. Finally, the attacker needs a method to observe the state change, often by analyzing cache timing or other hardware resource contention, to slowly reconstruct the leaked data.
Impact réel

Real-world CVEs caused by CWE-1342

  • Load value injection in some processors utilizing speculative execution may allow an authenticated user to enable information disclosure via a side-channel with local access.

Comment les attaquants l'exploitent

Parcours de l'attaquant étape par étape

  1. 1

    Faulting loads in a victim domain may trigger incorrect transient forwarding, which leaves secret-dependent traces in the microarchitectural state. Consider this example from [REF-1203].

  2. 2

    Consider the code gadget:

  3. 3

    A processor with this weakness will store the value of untrusted_arg (which may be provided by an attacker) to the stack, which is trusted memory. Additionally, this store operation will save this value in some microarchitectural buffer, e.g. the store queue. In this code gadget, trusted_ptr is dereferenced while the attacker forces a page fault. The faulting load causes the processor to mis-speculate by forwarding untrusted_arg as the (speculative) load result. The processor then uses untrusted_arg for the pointer dereference. After the fault has been handled and the load has been re-issued with the correct argument, secret-dependent information stored at the address of trusted_ptr remains in microarchitectural state and can be extracted by an attacker using a code gadget.

Exemple de code vulnérable

Vulnerable C

Consider the code gadget:

Vulnérable C
void call_victim(size_t untrusted_arg) {
  	 *arg_copy = untrusted_arg;
  	 array[**trusted_ptr * 4096];
   }
Exemple de code sécurisé

Secure pseudo

Sécurisé pseudo
// Validate, sanitize, or use a safe API before reaching the sink.
function handleRequest(input) {
  const safe = validateAndEscape(input);
  return executeWithGuards(safe);
}
What changed: the unsafe sink is replaced (or the input is validated/escaped) so the same payload no longer triggers the weakness.
Liste de contrôle de prévention

How to prevent CWE-1342

  • Architecture and Design / Requirements Hardware ensures that no illegal data flows from faulting micro-ops exists at the microarchitectural level.
  • Build and Compilation Include instructions that explicitly remove traces of unneeded computations from software interactions with microarchitectural elements e.g. lfence, sfence, mfence, clflush.
Signaux de détection

How to detect CWE-1342

SAST High

Exécuter une analyse statique (SAST) sur le code source à la recherche du motif non sécurisé dans le flux de données.

DAST Moderate

Exécuter des tests de sécurité applicative dynamique (DAST) contre le point de terminaison en ligne.

Runtime Moderate

Surveiller les journaux runtime pour détecter des traces d'exception inhabituelles, des entrées malformées ou des tentatives de contournement d'autorisation.

Code review Moderate

Revue de code : signaler tout nouveau code qui traite les entrées de cette surface sans utiliser les helpers du framework validés.

Correction automatique Plexicus

Plexicus détecte automatiquement CWE-1342 et ouvre une PR de correction en moins de 60 secondes.

Codex Remedium analyse chaque commit, identifie cette faiblesse précise et livre une pull request prête à être relue avec le correctif. Pas de tickets. Pas de transferts.

Questions fréquentes

Frequently asked questions

Qu'est-ce que CWE-1342 ?

This vulnerability occurs when a CPU fails to completely erase temporary data traces left behind by speculative execution or error recovery processes. These lingering microarchitectural hints can be analyzed through side-channels to leak sensitive information.

Quelle est la gravité de CWE-1342 ?

MITRE n'a pas publié de note de probabilité d'exploitation pour cette faiblesse. Traitez-la comme un impact moyen jusqu'à ce que votre modèle de menace prouve le contraire.

Quels langages ou plateformes sont affectés par CWE-1342 ?

MITRE lists the following affected platforms: Not OS-Specific, Workstation, x86, ARM, Other, Not Technology-Specific, System on Chip.

Comment puis-je prévenir CWE-1342 ?

Hardware ensures that no illegal data flows from faulting micro-ops exists at the microarchitectural level. Include instructions that explicitly remove traces of unneeded computations from software interactions with microarchitectural elements e.g. lfence, sfence, mfence, clflush.

Comment Plexicus détecte et corrige CWE-1342 ?

Le moteur SAST de Plexicus reconnaît la signature de flux de données de CWE-1342 à chaque commit. Lorsqu'une correspondance est trouvée, notre agent Codex Remedium ouvre une PR de correction avec le code corrigé, les tests et un résumé d'une ligne pour le relecteur.

Où puis-je en savoir plus sur CWE-1342 ?

MITRE publie la définition canonique à https://cwe.mitre.org/data/definitions/1342.html. Vous pouvez également consulter la documentation OWASP et NIST pour des conseils adjacents.

Prêt quand vous l'êtes

Arrêtez de payer par développeur.
Commencez à fermer la boucle.

Plexicus est l'ASPM natif IA qui scanne, filtre, corrige, penteste et explique — de façon autonome. Développeurs illimités, dépôts illimités, actions IA à usage équitable. Vrai niveau gratuit, €269/mo annuel quand vous êtes prêt.