Symmetric denial of service - SMTP
Description
The server crashes with multiple requests to the SMTP service that is responsible for testing the sending of emails, since the txtEmail attribute does not validate the number of emails or characters that can be entered.
Impact
Cause a denial of service.
Recommendation
Define a character or email limit for the txtEmail field.
Threat
Authenticated Internet attacker.
Expected Remediation Time
⌚ 60 minutes.
Score
Default score using CVSS 3.1. It may change depending on the context of the vulnerability.
Base
- Attack vector: N
- Attack complexity: L
- Privileges required: L
- User interaction: N
- Scope: U
- Confidentiality: N
- Integrity: N
- Availability: H
Temporal
- Exploit code madurity: X
- Remediation level: X
- Report confidence: X
Result
- Vector string: CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H/E:X/RL:X/RC:X
- Score:
- Base: 6.5
- Temporal: 6.5
- Severity:
- Base: Medium
- Temporal: Medium
Code Examples
Compliant code
All input data is correctly verified on the server side
public static void Test(string server, string txtEmail) {
string to = "user";
string from = "user";
//Validate the txtEmail input field
string sanitizedEmail = checkTxtEmailInput(txtEmail);
MailMessage message = new MailMessage(from, to, sanitizedEmail);
message.Subject = "Subject";
message.Body = @"Body";
SmtpClient client = new SmtpClient(server);
client.UseDefaultCredentials = true;
client.EnableSsl = true;
client.Send(message);
}
Non compliant code
The application does not perform server side validation of some input data
public static void Test(string server, string txtEmail) {
string to = "user";
string from = "user";
//Create Message without validating length or number of emails
MailMessage message = new MailMessage(from, to, txtEmail);
message.Subject = "Subject";
message.Body = @"Body";
SmtpClient client = new SmtpClient(server);
client.UseDefaultCredentials = true;
client.EnableSsl = true;
client.Send(message);
}
Requirements
Search for vulnerabilities in your apps for free with our automated security testing! Start your 21-day free trial and discover the benefits of our Continuous Hacking Machine Plan. If you prefer a full service that includes the expertise of our ethical hackers, don't hesitate to contact us for our Continuous Hacking Squad Plan.