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 an SQL injection vulnerability present here. #334

Open
Cyber0xFE opened this issue Dec 9, 2024 · 0 comments
Open

There is an SQL injection vulnerability present here. #334

Cyber0xFE opened this issue Dec 9, 2024 · 0 comments

Comments

@Cyber0xFE
Copy link

Cyber0xFE commented Dec 9, 2024

Vulnerability Risk

It can lead to the leakage of sensitive information from the database.

Vulnerability Reproduction

@Router /api/v1/role [post]
Set the roleKey field in the request body of this API with a blind SQL injection payload:

{
	"roleKey": "'-(if((substr(database(),1,1)='f'),sleep(3),1))-'"
}

The backend code first writes this payload to the role_key field of the sys_role table. Later, when writing to the sys_role_menu table or the casbin_rule table, it references this role_key field, which leads to a secondary (or second-order) SQL injection.

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