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

Fix broken Access Control #64

Open
jeagercoder opened this issue Jul 6, 2024 · 1 comment
Open

Fix broken Access Control #64

jeagercoder opened this issue Jul 6, 2024 · 1 comment
Assignees
Labels
bug Something isn't working security Security related

Comments

@jeagercoder
Copy link

jeagercoder commented Jul 6, 2024

Security report

Describe the bug

No access control implemented, the user data update endpoint is not authenticated so anyone can change any user data

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

I found a lot of logic that does not implement access control, one of which is:

const submission = parse(formData, { schema: schemaUserFullName })
    if (!submission.value) return json(submission, { status: 400 })
    await modelUser.updateFullName(submission.value)
    await timer.delay()
    return json(submission)
curl 'https://bandungdev.com/user/settings?_data=routes%2Fuser.settings' --data-raw 'id=userId&intent=user-change-fullname&fullname=Hacked by jeager'

Screenshot from 2024-07-07 00-16-25

Reference

OWASP Broken Access Control

@jeagercoder jeagercoder added the bug Something isn't working label Jul 6, 2024
@mhaidarhanif mhaidarhanif changed the title Broken Access Control Fix broken Access Control Jul 9, 2024
@mhaidarhanif mhaidarhanif added the security Security related label Jul 9, 2024
@mhaidarhanif
Copy link
Member

mhaidarhanif commented Jul 9, 2024

Thanks @jeagercoder for the security report.

We'll fix to put all the important route loaders/actions to include the authorization access control.

In the meantime I've restored the backup already.

References:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working security Security related
Projects
None yet
Development

No branches or pull requests

4 participants