Skip to content

Commit

Permalink
Fixed JXPath library vulnerability (#1651)
Browse files Browse the repository at this point in the history
  • Loading branch information
szczygiel-m authored Jan 19, 2023
1 parent d9dfb02 commit 72ecc5a
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package pl.allegro.tech.hermes.management.infrastructure.query.graph;

import org.apache.commons.jxpath.FunctionLibrary;
import org.apache.commons.jxpath.JXPathContext;

public class JXPathAttribute implements ObjectAttribute {
Expand All @@ -15,6 +16,8 @@ public JXPathAttribute(Object target, String path) {

@Override
public Object value() {
return JXPathContext.newContext(target).getValue(path);
JXPathContext context = JXPathContext.newContext(target);
context.setFunctions(new FunctionLibrary());
return context.getValue(path);
}
}

0 comments on commit 72ecc5a

Please sign in to comment.