Skip to content

Commit 72ecc5a

Browse files
authored
Fixed JXPath library vulnerability (#1651)
1 parent d9dfb02 commit 72ecc5a

File tree

1 file changed

+4
-1
lines changed
  • hermes-management/src/main/java/pl/allegro/tech/hermes/management/infrastructure/query/graph

1 file changed

+4
-1
lines changed

hermes-management/src/main/java/pl/allegro/tech/hermes/management/infrastructure/query/graph/JXPathAttribute.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
package pl.allegro.tech.hermes.management.infrastructure.query.graph;
22

3+
import org.apache.commons.jxpath.FunctionLibrary;
34
import org.apache.commons.jxpath.JXPathContext;
45

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

1617
@Override
1718
public Object value() {
18-
return JXPathContext.newContext(target).getValue(path);
19+
JXPathContext context = JXPathContext.newContext(target);
20+
context.setFunctions(new FunctionLibrary());
21+
return context.getValue(path);
1922
}
2023
}

0 commit comments

Comments
 (0)