diff --git a/java/ql/src/experimental/Security/CWE/CWE-502/UnsafeSpringExporterInConfigurationClass.qhelp b/java/ql/src/experimental/Security/CWE/CWE-502/UnsafeSpringExporterInConfigurationClass.qhelp index 87a57b0a43cb..8580092b8a1a 100644 --- a/java/ql/src/experimental/Security/CWE/CWE-502/UnsafeSpringExporterInConfigurationClass.qhelp +++ b/java/ql/src/experimental/Security/CWE/CWE-502/UnsafeSpringExporterInConfigurationClass.qhelp @@ -1,82 +1,8 @@ - + - - -

-The Spring Framework provides an abstract base class RemoteInvocationSerializingExporter -for creating remote service exporters. -A Spring exporter, which is based on this class, deserializes incoming data using ObjectInputStream. -Deserializing untrusted data is easily exploitable and in many cases allows an attacker -to execute arbitrary code. -

-

-The Spring Framework also provides two classes that extend RemoteInvocationSerializingExporter: -

  • -HttpInvokerServiceExporter -
  • -
  • -SimpleHttpInvokerServiceExporter -
  • -

    -

    -These classes export specified beans as HTTP endpoints that deserialize data from an HTTP request -using unsafe ObjectInputStream. If a remote attacker can reach such endpoints, -it results in remote code execution in the worst case. -

    -

    -CVE-2016-1000027 has been assigned to this issue in the Spring Framework. -It is regarded as a design limitation, and can be mitigated but not fixed outright. -

    -
    - - -

    -Avoid using HttpInvokerServiceExporter, SimpleHttpInvokerServiceExporter -and any other exporter that is based on RemoteInvocationSerializingExporter. -Instead, use other message formats for API endpoints (for example, JSON), -but make sure that the underlying deserialization mechanism is properly configured -so that deserialization attacks are not possible. If the vulnerable exporters can not be replaced, -consider using global deserialization filters introduced in JEP 290. -

    -
    - - -

    -The following example shows how a vulnerable HTTP endpoint can be defined -using HttpInvokerServiceExporter and Spring annotations: -

    - -
    - - -
  • -OWASP: -Deserialization of untrusted data. -
  • -
  • -Spring Framework API documentation: -RemoteInvocationSerializingExporter class -
  • -
  • -Spring Framework API documentation: -HttpInvokerServiceExporter class -
  • -
  • -National Vulnerability Database: -CVE-2016-1000027 -
  • -
  • -Tenable Research Advisory: -[R2] Pivotal Spring Framework HttpInvokerServiceExporter readRemoteInvocation Method Untrusted Java Deserialization -
  • -
  • -Spring Framework bug tracker: -Sonatype vulnerability CVE-2016-1000027 in Spring-web project -
  • -
  • -OpenJDK: -JEP 290: Filter Incoming Serialization Data -
  • -
    - + + +
    \ No newline at end of file diff --git a/java/ql/src/experimental/Security/CWE/CWE-502/UnsafeSpringExporterInConfigurationClassExample.inc.qhelp b/java/ql/src/experimental/Security/CWE/CWE-502/UnsafeSpringExporterInConfigurationClassExample.inc.qhelp new file mode 100644 index 000000000000..ed33a03fabed --- /dev/null +++ b/java/ql/src/experimental/Security/CWE/CWE-502/UnsafeSpringExporterInConfigurationClassExample.inc.qhelp @@ -0,0 +1,14 @@ + + + + +

    +The following example shows how a vulnerable HTTP endpoint can be defined +using HttpInvokerServiceExporter and Spring annotations: +

    + +
    + +
    \ No newline at end of file diff --git a/java/ql/src/experimental/Security/CWE/CWE-502/UnsafeSpringExporterInXMLConfiguration.qhelp b/java/ql/src/experimental/Security/CWE/CWE-502/UnsafeSpringExporterInXMLConfiguration.qhelp index dcefdfb97b06..76dda5842b3a 100644 --- a/java/ql/src/experimental/Security/CWE/CWE-502/UnsafeSpringExporterInXMLConfiguration.qhelp +++ b/java/ql/src/experimental/Security/CWE/CWE-502/UnsafeSpringExporterInXMLConfiguration.qhelp @@ -1,81 +1,8 @@ - + - - -

    -The Spring Framework provides an abstract base class RemoteInvocationSerializingExporter -for creating remote service exporters. -A Spring exporter, which is based on this class, deserializes incoming data using ObjectInputStream. -Deserializing untrusted data is easily exploitable and in many cases allows an attacker -to execute arbitrary code. -

    -

    -The Spring Framework also provides two classes that extend RemoteInvocationSerializingExporter: -

  • -HttpInvokerServiceExporter -
  • -
  • -SimpleHttpInvokerServiceExporter -
  • -

    -

    -These classes export specified beans as HTTP endpoints that deserialize data from an HTTP request -using unsafe ObjectInputStream. If a remote attacker can reach such endpoints, -it results in remote code execution in the worst case. -

    -

    -CVE-2016-1000027 has been assigned to this issue in the Spring Framework. -It is regarded as a design limitation, and can be mitigated but not fixed outright. -

    -
    - - -

    -Avoid using HttpInvokerServiceExporter, SimpleHttpInvokerServiceExporter -and any other exporter that is based on RemoteInvocationSerializingExporter. -Instead, use other message formats for API endpoints (for example, JSON), -but make sure that the underlying deserialization mechanism is properly configured -so that deserialization attacks are not possible. If the vulnerable exporters can not be replaced, -consider using global deserialization filters introduced in JEP 290. -

    -
    - - -

    -The following examples shows how a vulnerable HTTP endpoint can be defined in a Spring XML config: -

    - -
    - - -
  • -OWASP: -Deserialization of untrusted data. -
  • -
  • -Spring Framework API documentation: -RemoteInvocationSerializingExporter class -
  • -
  • -Spring Framework API documentation: -HttpInvokerServiceExporter class -
  • -
  • -National Vulnerability Database: -CVE-2016-1000027 -
  • -
  • -Tenable Research Advisory: -[R2] Pivotal Spring Framework HttpInvokerServiceExporter readRemoteInvocation Method Untrusted Java Deserialization -
  • -
  • -Spring Framework bug tracker: -Sonatype vulnerability CVE-2016-1000027 in Spring-web project -
  • -
  • -OpenJDK: -JEP 290: Filter Incoming Serialization Data -
  • -
    - + + +
    \ No newline at end of file diff --git a/java/ql/src/experimental/Security/CWE/CWE-502/UnsafeSpringExporterInXMLConfigurationExample.inc.qhelp b/java/ql/src/experimental/Security/CWE/CWE-502/UnsafeSpringExporterInXMLConfigurationExample.inc.qhelp new file mode 100644 index 000000000000..bc18f4dc2334 --- /dev/null +++ b/java/ql/src/experimental/Security/CWE/CWE-502/UnsafeSpringExporterInXMLConfigurationExample.inc.qhelp @@ -0,0 +1,13 @@ + + + + +

    +The following examples shows how a vulnerable HTTP endpoint can be defined in a Spring XML config: +

    + +
    + +
    \ No newline at end of file diff --git a/java/ql/src/experimental/Security/CWE/CWE-502/UnsafeSpringExporterQuery.inc.qhelp b/java/ql/src/experimental/Security/CWE/CWE-502/UnsafeSpringExporterQuery.inc.qhelp new file mode 100644 index 000000000000..732c5c7e545e --- /dev/null +++ b/java/ql/src/experimental/Security/CWE/CWE-502/UnsafeSpringExporterQuery.inc.qhelp @@ -0,0 +1,41 @@ + + + + +

    +The Spring Framework provides an abstract base class RemoteInvocationSerializingExporter +for creating remote service exporters. +A Spring exporter, which is based on this class, deserializes incoming data using ObjectInputStream. +Deserializing untrusted data is easily exploitable and in many cases allows an attacker +to execute arbitrary code. +

    +

    +The Spring Framework also provides HttpInvokerServiceExporter +and SimpleHttpInvokerServiceExporter classes +that extend RemoteInvocationSerializingExporter. +

    +

    +These classes export specified beans as HTTP endpoints that deserialize data from an HTTP request +using unsafe ObjectInputStream. If a remote attacker can reach such endpoints, +it results in remote code execution in the worst case. +

    +

    +CVE-2016-1000027 has been assigned to this issue in the Spring Framework. +It is regarded as a design limitation, and can be mitigated but not fixed outright. +

    +
    + + +

    +Avoid using HttpInvokerServiceExporter, SimpleHttpInvokerServiceExporter +and any other exporter that is based on RemoteInvocationSerializingExporter. +Instead, use other message formats for API endpoints (for example, JSON), +but make sure that the underlying deserialization mechanism is properly configured +so that deserialization attacks are not possible. If the vulnerable exporters can not be replaced, +consider using global deserialization filters introduced in JEP 290. +

    +
    + +
    \ No newline at end of file diff --git a/java/ql/src/experimental/Security/CWE/CWE-502/UnsafeSpringExporterReferences.inc.qhelp b/java/ql/src/experimental/Security/CWE/CWE-502/UnsafeSpringExporterReferences.inc.qhelp new file mode 100644 index 000000000000..94d269e35d0d --- /dev/null +++ b/java/ql/src/experimental/Security/CWE/CWE-502/UnsafeSpringExporterReferences.inc.qhelp @@ -0,0 +1,37 @@ + + + + +
  • +OWASP: +Deserialization of untrusted data. +
  • +
  • +Spring Framework API documentation: +RemoteInvocationSerializingExporter class +
  • +
  • +Spring Framework API documentation: +HttpInvokerServiceExporter class +
  • +
  • +National Vulnerability Database: +CVE-2016-1000027 +
  • +
  • +Tenable Research Advisory: +[R2] Pivotal Spring Framework HttpInvokerServiceExporter readRemoteInvocation Method Untrusted Java Deserialization +
  • +
  • +Spring Framework bug tracker: +Sonatype vulnerability CVE-2016-1000027 in Spring-web project +
  • +
  • +OpenJDK: +JEP 290: Filter Incoming Serialization Data +
  • +
    + +
    \ No newline at end of file