Potential DoS due to PasswordPoliciesNotMet in errors.go
The PasswordPoliciesNotMet error type collects an unbounded list of individual password policy errors and joins them into one string. If many policies fail at once, the report claims this could consume large amounts of memory or crash the system.
- Triaged in 35 hours
- Disclosed after 24 months
Summary:
Possible DoS depending on amount of PasswordPolicyError instances that can be created in a short time
type PasswordPoliciesNotMet struct {
UnMetPasswordPolicies []PasswordPolicyError
}
func (e PasswordPoliciesNotMet) Error() string {
errorStrs := make([]string, 0, len(e.UnMetPasswordPolicies))
for _, ppe := range e.UnMetPasswordPolicies {
errorStrs = append(errorStrs, ppe.Error())
}
return fmt.Sprintf("Password policies not met due to: %s", strings.Join(errorStrs, ", "))
}
Bug:
The possible vulnerability is in the PasswordPoliciesNotMet struct. This struct collects all errors when password policies fail. But it does not limit the number of errors it can collect. If multiple instance of policies fail together, the struct will have huge number of errors. This can make system use lot of memory or even crash due to flood of errors.
Fix:
To fix this, we need to make sure the PasswordPoliciesNotMet struct doesn't collect an unlimited number of errors. Set a limit on how many errors it can store or find some other way to handle a large number of errors in better way.
Impact
Can lead to lot of memory consumption or denial of service(DoS) attack if many policies fail together.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the error struct appends every failed policy error without any upper bound before joining them into a single string.
Impact
The report claims this could lead to high memory consumption or a denial of service if many policies fail together, but it provides no demonstration and does not show how an attacker would trigger a large number of failures.
What the attacker needed
Ability to trigger many policy failures
The fix
The struct should cap how many errors it stores, or handle large numbers of errors in a more efficient way.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this report has not been written yet. The Original tab links to the source.
When a password is rejected, the program builds a message listing every rule that was broken. This report says nothing caps how many of those messages can pile up, so a very large pile could use a lot of memory. The report does not show this actually happening, it is a theoretical concern.
What is DoS?
A request that exhausts resources or crashes a component. Many programs forbid testing it; reports usually show it from code, not by attacking.