class

CWE::Weakness

Inherits Comparable < Reference < Object

A single CWE entry.

Instances are constructed once when the embedded catalog is loaded (CWE::Catalog) and are then immutable. All accessors are pure reads over the parsed data — no I/O happens after the initial load.

w = CWE.find!("CWE-79")
w.name                  # => "Improper Neutralization of Input During Web Page Generation ('Cross-site Scripting')"
w.abstraction           # => CWE::Abstraction::Base
w.parents.map(&.cwe_id) # => [74]

Constructors

Instance methods

<=>(other : Weakness) : Int32

Order by numeric id — useful for stable sort of result sets.

Source
==(other : Weakness) : Bool

Compares this object to other based on the receiver’s <=> method, returning true if it returns 0.

Also returns true if this and other are the same object.

Source
abstraction
Source
affected_resources
Source
alternate_terms
Source
applicable_platforms
Source
background_details
Source
capec_ids

CAPEC IDs this weakness is mapped to (Common Attack Pattern Enumeration).

Source
chain?
Source
common_consequences
Source
composite?
Source
compound?

True for any Compound entry (Chain or Composite).

Source
content_history
Source
cwe_id

Canonical identifier with the CWE- prefix, e.g. "CWE-79".

Source
demonstrative_examples
Source
deprecated?

True if the catalog marks this entry deprecated.

Source
description
Source
detection_methods
Source
exploitation_factors
Source
extended_description
Source
functional_areas
Source
hash(hasher)

See Object#hash(hasher)

Source
inspect(io : IO) : Nil

Appends a String representation of this object which includes its class name, its object address and the values of all instance variables.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).inspect # => #<Person:0x10fd31f20 @name="John", @age=32>
Source
likelihood_of_exploit
Source
mappable?

True when MITRE marks this entry as an acceptable mapping target (Allowed or Allowed-with-Review).

Source
mapping_notes
Source
mapping_usage

CWE 4.x mapping policy. MappingUsage::Other is returned when the entry has no <Mapping_Notes> block (older entries; categories that predate the policy).

Source
modes_of_introduction
Source
name
Source
notes
Source
observed_examples
Source
ordinalities
Source
owasp_mappings

OWASP entries in taxonomy_mappings.

Source
potential_mitigations
Source
raw_abstraction

Raw fields kept for the catalog's internal use; not part of the public surface but exposed for callers that want to introspect the underlying representation.

Source
raw_status
Source
raw_structure
Source
status
Source
structure
Source
summary

Single-line summary suitable for log lines / CLI output: "CWE-79: Improper Neutralization of Input ... (Base, Stable)".

Source
taxonomy_mappings
Source
to_json(json : JSON::Builder) : Nil
Source
to_s(io : IO) : Nil

Appends a short String representation of this object which includes its class name and its object address.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).to_s # => #<Person:0x10a199f20>
Source
url

URL on cwe.mitre.org for this entry.

Source