CWE-358 Base Brouillon

Improperly Implemented Security Check for Standard

This vulnerability occurs when software fails to correctly implement one or more critical security checks required by a standard protocol, algorithm, or security technique.

Définition

What is CWE-358?

This vulnerability occurs when software fails to correctly implement one or more critical security checks required by a standard protocol, algorithm, or security technique.
Standards like TLS, OAuth, or cryptographic algorithms define specific security checks—such as certificate validation, timing attack mitigations, or proper error handling—to ensure their overall security. When developers implement these standards but miss, weaken, or incorrectly code these mandatory checks, they inadvertently introduce a security flaw while believing they are compliant. The software appears to follow the standard but contains a hidden weakness that attackers can exploit. This issue is particularly dangerous because it often evades casual review; the code looks correct on the surface. To prevent it, developers must treat the standard's security requirements as a strict checklist, not just a guideline. Security reviews and testing should specifically verify that each mandated check is implemented robustly and cannot be bypassed under any edge case or error condition.
Impact réel

Real-world CVEs caused by CWE-358

  • Browser does not verify Basic Constraints of a certificate, even though it is required, allowing spoofing of trusted certificates.

  • Browser does not verify Basic Constraints of a certificate, even though it is required, allowing spoofing of trusted certificates.

  • Browser does not verify Basic Constraints of a certificate, even though it is required, allowing spoofing of trusted certificates.

  • Logic error prevents some required conditions from being enforced during Challenge-Response Authentication Mechanism with MD5 (CRAM-MD5).

  • Shared secret not verified in a RADIUS response packet, allowing authentication bypass by spoofing server replies.

  • Insufficient verification in VoIP implementation, in violation of standard, allows spoofed messages.

  • Insufficient verification in VoIP implementation, in violation of standard, allows spoofed messages.

  • Security check not applied to all components, allowing bypass.

Comment les attaquants l'exploitent

Parcours de l'attaquant étape par étape

  1. 1

    Identifier un chemin de code qui traite des entrées non fiables sans validation.

  2. 2

    Élaborer une charge utile qui exploite le comportement non sécurisé — injection, traversal, débordement ou abus de logique.

  3. 3

    Délivrer la charge utile via une requête normale et observer la réaction de l'application.

  4. 4

    Itérer jusqu'à ce que la réponse divulgue des données, exécute le code de l'attaquant ou élève les privilèges.

Exemple de code vulnérable

Vulnerable pseudo

MITRE n'a pas publié d'exemple de code pour ce CWE. Le motif ci-dessous est illustratif — voir Ressources pour les références canoniques.

Vulnérable pseudo
// Example pattern — see MITRE for the canonical references.
function handleRequest(input) {
  // Untrusted input flows directly into the sensitive sink.
  return executeUnsafe(input);
}
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-358

  • Architecture Use safe-by-default frameworks and APIs that prevent the unsafe pattern from being expressible.
  • Implementation Validate input at trust boundaries; use allowlists, not denylists.
  • Implementation Apply the principle of least privilege to credentials, file paths, and runtime permissions.
  • Testing Cover this weakness in CI: SAST rules + targeted unit tests for the data flow.
  • Operation Monitor logs for the runtime signals listed in the next section.
Signaux de détection

How to detect CWE-358

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-358 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-358 ?

This vulnerability occurs when software fails to correctly implement one or more critical security checks required by a standard protocol, algorithm, or security technique.

Quelle est la gravité de CWE-358 ?

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-358 ?

MITRE n'a pas spécifié les plateformes affectées pour ce CWE — il peut s'appliquer à la plupart des stacks applicatives.

Comment puis-je prévenir CWE-358 ?

Use safe-by-default frameworks, validate untrusted input at trust boundaries, and apply the principle of least privilege. Cover the data-flow signature in CI with SAST.

Comment Plexicus détecte et corrige CWE-358 ?

Le moteur SAST de Plexicus reconnaît la signature de flux de données de CWE-358 à 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-358 ?

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

Faiblesses associées

Weaknesses related to CWE-358

CWE-573 Parent

Improper Following of Specification by Caller

This weakness occurs when software fails to properly follow the documented rules, protocols, or requirements of an external component it…

CWE-103 Frère

Struts: Incomplete validate() Method Definition

This vulnerability occurs in a Struts application when a validator form either completely omits a validate() method or includes one but…

CWE-104 Frère

Struts: Form Bean Does Not Extend Validation Class

This vulnerability occurs in Apache Struts applications when a form bean class does not properly extend the framework's validation class.…

CWE-243 Frère

Creation of chroot Jail Without Changing Working Directory

This vulnerability occurs when a program creates a chroot jail but fails to change its current working directory afterward. Because the…

CWE-253 Frère

Incorrect Check of Function Return Value

This vulnerability occurs when a program misinterprets or improperly validates the return value from a function, causing it to miss…

CWE-296 Frère

Improper Following of a Certificate's Chain of Trust

This vulnerability occurs when software fails to properly validate the entire certificate chain back to a trusted root authority. This…

CWE-304 Frère

Missing Critical Step in Authentication

This vulnerability occurs when a software authentication process omits a required step, weakening its overall security.

CWE-325 Frère

Missing Cryptographic Step

This vulnerability occurs when a software implementation skips a critical step in a cryptographic process, resulting in security that is…

CWE-329 Frère

Generation of Predictable IV with CBC Mode

This vulnerability occurs when software uses a predictable or reused Initialization Vector (IV) with Cipher Block Chaining (CBC) mode…

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.