Looking for the vulnerability index of Invicti's legacy products?
HTML form susceptible to spam - Vulnerability Database

HTML form susceptible to spam

Description

This alert may be a false positive, manual confirmation is required.

An HTML form was detected that may be vulnerable to email spam abuse. The form contains a hidden input field with an email address as its value, suggesting that the email recipient is hardcoded on the client side. Since hidden form fields can be modified by attackers using browser developer tools or intercepting proxies, malicious users could alter the recipient address to send unauthorized emails through your server. This configuration allows spammers to exploit your mail server as an open relay for distributing spam or phishing campaigns.

Remediation

Implement server-side validation and control of email recipients to prevent client-side manipulation:

1. Remove hardcoded email addresses from hidden form fields
Never trust client-side data for determining email recipients. Remove any hidden input fields containing email addresses.

2. Define recipients on the server side
Configure allowed recipient addresses in your server-side code or configuration files where they cannot be modified by users.

Example (PHP):

// BAD - Client controls recipient
$to = $_POST['recipient']; // Dangerous!

// GOOD - Server controls recipient
$allowed_recipients = [
  'contact' => 'contact@example.com',
  'support' => 'support@example.com'
];
$form_type = $_POST['form_type'];
$to = $allowed_recipients[$form_type] ?? 'default@example.com';

3. Implement rate limiting
Add rate limiting to prevent abuse even if the form is compromised. Limit submissions per IP address or session to a reasonable number per time period.

4. Add CAPTCHA or similar verification
Implement CAPTCHA, reCAPTCHA, or similar anti-automation measures to prevent automated spam submissions.

5. Log and monitor form submissions
Maintain logs of all form submissions and monitor for suspicious patterns or unusual volumes of activity.

Related Vulnerabilities