= get-cwe(1)
Tioben Neenot
v1.10.1
:doctype: manpage
:manmanual: GET-CWE
:mansource: GET-CWE
:man-linkstyle: pass:[blue R < >]

== Name

get-cwe - Explore the CWE according to the given id.

== Usage

*get-cwe* [options]

== Options

*h or help*:: Shows online help.

*c or check [--db|-d]*:: Runs a simple query for verifying that the nvd api rest site is available.
Shows *Valid* if the url testes is available.
Shows *Invalid* if the site is unavailable.
If `--db` or `-d` option is set, check if local database is available or not.

*CWE-<num>*:: Search the CWE id based on the format: `CWE-<num>` where `<num>`
is the awaiting CWE id.

With these options, other complementary options can be added to get more details information about the CWE required.
These options are describing below.

*-a or --all*:: Shows all CWE data.

*-A or --capec*:: Shows the associated attacks list.

*-c or --cons*:: Shows only the CWE consequences.
Consequences list all available scope and impact of the CWE.

*-t or --desc*:: Shows the description of the CWE.

*-e or --detect*:: Shows the recommended detection for this CWE.
The detections show the list of recommended methods with their descriptions and the estimated effectiveness.

*-m or --mitigation*:: Shows the mitigation section for this CWE.

*-S or --schema*:: Shows the cwe schema with its capec and associated CVE.

*-x or --ext*:: Shows the extended description of the CWE.

*r or refresh*:: Refresh the content of the CWE database from last mitre publication.

*s or search <query>*:: Search cwe criteria according to the search query. *query* is explained below.

*v or version*:: shows the current version.

== Notes

This command is interesting to be used with the `get-cve` command.
See the help for this command for CWE-ID consulting for a given CVE.

== Examples

Standard CWE consultation:

[source,bash]
----
$ get-cwe cwe-91
 [ CWE-91 ]
  -> Name: XML Injection (aka Blind XPath Injection)
  > Description: The product does not properly neutralize special elements that are used in XML, allowing attackers to modify the syntax, content, or commands of the XML before it is processed by an end system.
   ...
----

Shows the description associated with this CWE:

[source,bash]
----
$ get-cwe cwe-91 --desc
 [ CWE-91 ]
  -> Name: XML Injection (aka Blind XPath Injection)
  > Description: The product does not properly neutralize special elements that are used in XML, allowing attackers to modify the syntax, content, or commands of the XML before it is processed by an end system.
----

List of consequences for this CWE:

[source,bash]
----
$ get-cwe CWE-91 --cons
 [ CWE-91 ]
  -> Name: XML Injection (aka Blind XPath Injection)
    [ Consequences ]
     [ Scope ]
      - Confidentiality
      - Integrity
      - Availability
     [ Impact ]
      - Execute Unauthorized Code or Commands
      - Read Application Data
      - Modify Application Data
----

Schema for a given CWE:

[source,bash]
----
$ get-cwe cwe-91 --schema
get-cwe cwe-91 --schema
 CWE-91
 ├─ CAPEC
 │  ├─ CAPEC-83 - XPath Injection
 │  └─ CAPEC-250 - XML Injection
 └─ CVE
    ├─ CVE-2008-5024
    ├─ CVE-2013-4221
    ├─ CVE-2013-4857
    ├─ CVE-2013-7429
    ├─ CVE-2014-1409
...
    ├─ CVE-2024-25413
    ├─ CVE-2024-2645
    ├─ CVE-2024-2648
    └─ CVE-2025-12921
----

== Query

The query is composing of 2 parts: a domain and a criteria.
The domain is one of the following keyword.

=== Keywords

- consequences: search query on the `consequences` of the cwe's field,
- description: search query on the `description` of the cwe's field,
- detections: search query on the `detections` of the cwe's field.
- extended: search query on the `extended` of the cwe's field.
- mitigations: search query on the `mitigations` of the cwe's field.
- name: search query on the `name` of the cwe's field.
- all: means the search query will be applied on all keywords above.

=== Criteria

The criteria is composing of a free text with optionally one or more operators.
Operators are:

- `and`: and operator like: `<word1> and <word2>`,
- `or`: or operator like: `<word1> or <word2>`,
- `not`: not operator like: `not <word1>`.

Operators can be chaining like: `<word1> and <word2> or <word3> and not <word4>`.

All criteria would be specified between `''`.
== Exit

*0*::
Exit with success

*1*::
An error was occurred.

== Copying

Copyright (C) 2026 Tioben Neenot. Free use of this software is granted under the terms of the MIT License.

== See also

get-capec(1), get-cpe(1), get-cve(1), get-mitre(1)
