Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XPath_Injection @ /src/main/java/org/cysecurity/cspf/jvl/controller/XPathQuery.java #178

Open
cyates-checkmarx opened this issue Jun 23, 2023 · 0 comments

Comments

@cyates-checkmarx
Copy link
Owner

cyates-checkmarx commented Jun 23, 2023

Checkmarx (SAST): XPath_Injection
Security Issue: Read More about XPath_Injection
Checkmarx Project: cyates-checkmarx/JVL
Repository URL: https://github.com/cyates-checkmarx/JVL
Branch: master
Scan ID: 6bf2c567-d73e-490c-ac86-a35dd14d497b


The application's processRequest method constructs an XPath query, for navigating an XML document. The XPath query is created with compile, at line 53 of /src/main/java/org/cysecurity/cspf/jvl/controller/XPathQuery.java, using an untrusted string embedded in the expression.  

This may enable an attacker to modify the XPath expression, leading to an XPath Injection attack.

The attacker may be able to inject the modified XPath expression via user input, ""password"", which is retrieved by the application in the processRequest method, at line 36 of /src/main/java/org/cysecurity/cspf/jvl/controller/XPathQuery.java. This value then flows through the code to compile, as noted.

Result #1:
Severity: HIGH
State: TO_VERIFY
Status: RECURRENT
Attack Vector:

    1. ""password"": /src/main/java/org/cysecurity/cspf/jvl/controller/XPathQuery.java[36,46]
    2. getParameter: /src/main/java/org/cysecurity/cspf/jvl/controller/XPathQuery.java[36,45]
    3. pass: /src/main/java/org/cysecurity/cspf/jvl/controller/XPathQuery.java[36,20]
    4. pass: /src/main/java/org/cysecurity/cspf/jvl/controller/XPathQuery.java[50,79]
    5. xPression: /src/main/java/org/cysecurity/cspf/jvl/controller/XPathQuery.java[50,20]
    6. xPression: /src/main/java/org/cysecurity/cspf/jvl/controller/XPathQuery.java[53,39]
    7. compile: /src/main/java/org/cysecurity/cspf/jvl/controller/XPathQuery.java[53,38]
    Review result in Checkmarx One: XPath_Injection

Result #2:
Severity: HIGH
State: TO_VERIFY
Status: RECURRENT
Attack Vector:

    1. ""username"": /src/main/java/org/cysecurity/cspf/jvl/controller/XPathQuery.java[35,46]
    2. getParameter: /src/main/java/org/cysecurity/cspf/jvl/controller/XPathQuery.java[35,45]
    3. user: /src/main/java/org/cysecurity/cspf/jvl/controller/XPathQuery.java[35,20]
    4. user: /src/main/java/org/cysecurity/cspf/jvl/controller/XPathQuery.java[50,55]
    5. xPression: /src/main/java/org/cysecurity/cspf/jvl/controller/XPathQuery.java[50,20]
    6. xPression: /src/main/java/org/cysecurity/cspf/jvl/controller/XPathQuery.java[53,39]
    7. compile: /src/main/java/org/cysecurity/cspf/jvl/controller/XPathQuery.java[53,38]
    Review result in Checkmarx One: XPath_Injection

@cyates-checkmarx cyates-checkmarx changed the title XPath_Injection @ XPathQuery.java XPath_Injection @ /src/main/java/org/cysecurity/cspf/jvl/controller/XPathQuery.java Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant