CodeAnt AI home pagelight logodark logo
  • Support
  • Dashboard
  • Dashboard
  • Join Community
Start Here
  • What is CodeAnt?
Setup
  • Github
  • Bitbucket
  • Gitlab
  • Azure Devops
Pull Request Review
  • Features
  • Customize Review
  • Quality Gates
  • Integrations
Scan center
  • Code Security
  • Code Quality
  • Cloud Security
  • Engineering Productivity
Integrations
  • Jira
  • Test Coverage
  • CI/CD
IDE
  • Setup
  • Review
  • Enhancements
Rule Reference
  • Compliance
  • Anti-Patterns
  • Code Governance
  • Infrastructure Security Database
  • Application Security Database
    • Apex
    • Bash
    • C
    • Clojure
    • Cpp
    • Csharp
    • Dockerfile
    • Elixir
    • Fingerprints
    • Generic
    • Go
    • Html
    • Java
      • Android
      • Aws-lambda
      • Castor
      • Java-jwt
      • Jax-rs
      • Jboss
      • Jdo
      • Jedis
      • Jjwt
      • Jsch
      • Kryo
      • Lang
      • Micronaut
      • Mongo
      • Mongodb
      • Mysql
      • Okhttp
      • Rmi
      • Servlets
      • Spring
        • Log-http-headers
        • Security
        • Security
          • Audit
          • Audit
          • Castor-deserialization-deepsemgrep
          • Hibernate-sqli
          • Injection
          • Jdbctemplate-sqli
          • Jdo-sqli
          • Jpa-sqli
          • Kryo-deserialization-deepsemgrep
          • Objectinputstream-deserialization-spring
          • Spring-sqli-deepsemgrep
          • Spring-tainted-code-execution
          • Spring-tainted-ldap-injection
          • Spring-tainted-xmldecoder
          • Tainted-ssrf-spring-add
          • Tainted-ssrf-spring-format
          • Xstream-anytype-deserialization-deepsemgrep
          • Xxe
            • Tainted-documentbuilderfactory-xxe-spring
              • Tainted documentbuilderfactory xxe spring
            • Tainted-saxbuilder-xxe-spring
            • Tainted-saxparser-xxe-spring
            • Tainted-saxreader-xxe-spring
            • Tainted-saxtransformerfactory-xxe-spring
            • Tainted-schemafactory-xxe-spring
            • Tainted-validator-xxe-spring
            • Tainted-xmlreader-xxe-spring
        • Simple-command-injection-direct-input
        • Spring-tainted-path-traversal
        • Tainted-html-string-responsebody
      • Thymeleaf
      • Xstream
    • Javascript
    • Json
    • Kotlin
    • Ocaml
    • Php
    • Problem-based-packs
    • Python
    • Ruby
    • Rust
    • Scala
    • Solidity
    • Swift
    • Terraform
    • Typescript
    • Yaml
Resources
  • Open Source
  • Blogs
Tainted-documentbuilderfactory-xxe-spring

Tainted documentbuilderfactory xxe spring

tainted-documentbuilderfactory-xxe-spring

The application is using an XML parser that has not been safely configured. This might lead to XML External Entity (XXE) vulnerabilities when parsing user-controlled input. An attacker can include document type definitions (DTDs) or XIncludes which can interact with internal or external hosts. XXE can lead to other vulnerabilities, such as Local File Inclusion (LFI), Remote Code Execution (RCE), and Server-side request forgery (SSRF), depending on the application configuration. An attacker can also use DTDs to expand recursively, leading to a Denial-of-Service (DoS) attack, also known as a Billion Laughs Attack. It is our recommendation to secure this parser against XXE attacks by configuring the DocumentBuilder parser with factory.setFeature(http://apache.org/xml/features/disallow-doctype-decl, true). Alternatively, the following configurations also provide protection against XXE attacks. factory.setExpandEntityReferences(false), factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true), factory.setAttribute(XMLConstants.ACCESS_EXTERNAL_DTD, ""), or enabling both factory.setFeature("http://xml.org/sax/features/external-general-entities", false) and factory.setFeature("http://xml.org/sax/features/external-general-entities", false);. For more information, see: Java XXE prevention
Likelihood: MEDIUM
Confidence: HIGH
CWE:
- CWE-611: Improper Restriction of XML External Entity Reference
OWASP:
- A04:2017 - XML External Entities (XXE)
- A05:2021 - Security Misconfiguration
Xstream anytype deserialization deepsemgrepTainted saxbuilder xxe spring
twitterlinkedin
Powered by Mintlify
Assistant
Responses are generated using AI and may contain mistakes.