Skip to main content

Crate use_cwe

Crate use_cwe 

Source
Expand description

§use-cwe

CWE weakness identifier and category primitives for RustUse.

§Experimental

use-cwe is experimental while the use-security workspace remains below 0.3.0. Expect small API adjustments during the first release wave.

§Example

use use_cwe::{CWE_79_XSS, CweId, CweWeaknessKind};

let id: CweId = "CWE-79".parse()?;

assert_eq!(id, CWE_79_XSS);
assert_eq!(CweWeaknessKind::CrossSiteScripting.as_str(), "cross-site-scripting");

§Scope

  • CWE ID validation for strings such as CWE-79 and CWE-352.
  • Common high-value CWE constants.
  • Small weakness, impact, likelihood, and taxonomy-source labels.

§Non-goals

  • Mirroring the full CWE database.
  • Weakness detection or static analysis.
  • CWE website scraping or network lookup.

§License

Licensed under either of the following, at your option:

  • Apache License, Version 2.0
  • MIT license

Structs§

CweId
A validated CWE identifier such as CWE-79.
CweNumber
Numeric CWE identifier component.

Enums§

CweIdError
Error returned when a CWE identifier is invalid.
CweImpactKind
CWE impact category labels.
CweLikelihood
CWE likelihood labels.
CweParseError
Error returned when a CWE label cannot be parsed.
CweTaxonomySource
CWE taxonomy source labels.
CweWeaknessKind
CWE weakness category labels.

Constants§

CWE_22_PATH_TRAVERSAL
CWE_78_OS_COMMAND_INJECTION
CWE_79_XSS
CWE_89_SQL_INJECTION
CWE_94_CODE_INJECTION
CWE_200_SENSITIVE_INFORMATION_EXPOSURE
CWE_287_IMPROPER_AUTHENTICATION
CWE_352_CSRF
CWE_862_MISSING_AUTHORIZATION
CWE_918_SSRF