Unsanitized user input in XML External Entity

Description

Avoid parsing untrusted data such as user input as XML. Such data could include URIs that resolve to resources that are outside of the current context, leading to XML External Entity (XXE) injection. XXE injection arises when XML input containing a reference to an external entity is processed without proper sanitization, potentially allowing attackers to access internal files, cause denial of service, or execute remote code.

Remediations

  • Do not parse XML input with external entity processing enabled. This prevents attackers from exploiting XXE vulnerabilities.

References

Associated CWE

OWASP Top 10

Configuration

To skip this rule during a scan, use the following flag

bearer scan /path/to/your-project/ --skip-rule=java_lang_xml_external_entity_vulnerability

To run only this rule during a scan, use the following flag

bearer scan /path/to/your-project/ --only-rule=java_lang_xml_external_entity_vulnerability