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

[security vulnerability] Vulnerability of Publishing Post with Arbitrary User #46

Open
GatekeeperBuster opened this issue Apr 25, 2023 · 0 comments

Comments

@GatekeeperBuster
Copy link

Recently, our team found a vulnerability of publishing post with arbitary user in the latest version of the project.
The vulnerability logic is present in the file: https://github.com/fanchaoo/forum/blob/master/src/main/java/com/fc/service/PostService.java#L57

image

The developer failed to check the ownership info of the post when querying a post insertion via postMapper.insertPost(post), which means accessor can publish post with the identity of arbitary users by /publishPost.do (i.e., https://github.com/fanchaoo/forum/blob/master/src/main/java/com/fc/controller/PostController.java#L47).

image

We recommend that developers add the access control policy before the insertion of post to ensure that the ownership info of the post is current accessor.

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