Login endpoint problems #119
Labels
No labels
bug
ci/cd
dependencies
design
docs
feature
feature-request
go
good first issue
improvement
refactor
vulnerability
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
dsc/mm-backend#119
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When sending a
POST /api/v1/loginrequest with the body{"email": "string", "password": "string"}, the server returns the following response:This behavior indicates two distinct vulnerabilities:
CWE-204 (Observable Response Discrepancy)
The server explicitly states that the user does not exist, rather than returning a generic "Invalid credentials" error. This facilitates User Enumeration, allowing attackers to verify which emails exist in the database and significantly reducing the complexity of password brute-force or credential stuffing attacks.
Information Disclosure (Leaking Internal Error State)
We are leaking the raw text from the internal Go error object directly to the client. This exposes the application's internal state. While it causes CWE-204 in this instance, this pattern could potentially leak even more sensitive information (e.g., database schema details or stack traces) in other scenarios.
DX Impact
Additionally, returning a 500 Internal Server Error for a logic error makes frontend integration difficult. The client cannot easily distinguish between a genuine server crash and a standard validation failure (incorrect credentials).
https://cwe.mitre.org/data/definitions/204.html
mentioned in merge request !251