You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jmeter.apache.org by FSchumacher <gi...@git.apache.org> on 2017/08/05 16:45:05 UTC

[GitHub] jmeter pull request #301: First stab at a whitelist for the xstream library.

Github user FSchumacher commented on a diff in the pull request:

    https://github.com/apache/jmeter/pull/301#discussion_r131525468
  
    --- Diff: src/core/org/apache/jmeter/util/JMeterUtils.java ---
    @@ -1261,10 +1265,39 @@ public static final void refreshUI() {
          */
         public static void setupXStreamSecurityPolicy(XStream xstream) {
             // This will lift the insecure warning
    +        // disallow any class
             xstream.addPermission(NoTypePermission.NONE);
    -        // We reapply very permissive policy
    -        // See https://groups.google.com/forum/#!topic/xstream-user/wiKfdJPL8aY
    -        // TODO : How much are we concerned by CVE-2013-7285 
    -        xstream.addPermission(AnyTypePermission.ANY);
    +        // allow some classes that are hopefully secure
    +        for (TypePermission perm : Arrays.asList(NullPermission.NULL,
    +                ArrayTypePermission.ARRAYS,
    +                PrimitiveTypePermission.PRIMITIVES)) {
    +            xstream.addPermission(perm);
    +        }
    +        for (Class<?> allowHierarchy : Arrays.asList(java.util.Collection.class,
    +                org.apache.jmeter.testelement.TestElement.class,
    +                org.apache.jorphan.collections.HashTree.class,
    +                org.apache.jmeter.samplers.SampleSaveConfiguration.class)) {
    +            xstream.allowTypeHierarchy(allowHierarchy);
    --- End diff --
    
    Done.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---