cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Beryozkin (Commented) (JIRA)" <>
Subject [jira] [Commented] (CXF-4172) Default JAX-RS JAXB, JSON and Form providers are open to the hash collision attacks
Date Wed, 14 Mar 2012 17:08:40 GMT


Sergey Beryozkin commented on CXF-4172:

A number of new contextual properties has been introduced to limit the depth of the incoming
XML or JSON payloads (processed with the help of JAXB) and form payloads.


"depthTotalElementCountThreshold" - restricts the total number of elements in a given payload.
"depthInnerElementCountThreshold" - restricts the total number of child elements for a given
"depthInnerElementLevelThreshold" - restricts the stack depth starting from a given element
(root by default).

These properties can be enforced in a number of ways. The simplest option is to enable them
on individual JAX-RS endpoints. Alternatively, default CXF JAX-RS JAXBElementProvider and
JSONProvider can have a 'depthProperties' set (
Finally they can instead depend on DepthRestrictingStreamInterceptor (
configured and added to the inbound chain.

Source and DOM Document providers will depend on DepthRestrictingStreamInterceptor.

More sophisticated properties can be introduced in the future.


"maxFormParameterCount" - restricts the number of form name-value pairs.
Note that the Servlet containers may also need to restrict the number of form parameters:

The clients will get HTTP 413 back whenever one of the above contextual properties can not
be enforced.

*Note*: other optional XML or JSON providers may need the related third-party library enhanced
to enforce the depth of the incoming payloads.

> Default JAX-RS JAXB, JSON and Form providers are open to the hash collision attacks
> -----------------------------------------------------------------------------------
>                 Key: CXF-4172
>                 URL:
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-RS, JAX-RS Security
>            Reporter: Sergey Beryozkin
>            Assignee: Sergey Beryozkin
>            Priority: Critical
>             Fix For: 2.3.10, 2.4.7, 2.5.3, 2.6
> JAXB based and Form providers using the Maps internally are open to the hash collision

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators:!default.jspa
For more information on JIRA, see:


View raw message