Skip to content

Security Vulnerability: Unsafe File Upload Implementation in Gallery #68

@Pragati5-DEBUG

Description

@Pragati5-DEBUG

Problem
I found some issues with the forms on the website. When I tried to submit the newsletter form with an invalid email, it accepted it without any warning. Also, the contact form doesn't check if the input is valid
What I Found

  1. Newsletter form accepts any email format

    • Tried entering "test@" and it was accepted
    • No warning message shown
  2. Contact form has no validation

    • Can submit empty forms
    • No character limit on messages

How to Fix

  1. Add proper email validation

    • Check if email has proper format (e.g., "user@example.com")
    • Show error message if email is invalid
  2. Add basic form validation

    • Make required fields mandatory
    • Add maximum length for text inputs
    • Show error messages to users

Example

Here's a simple example of how the email validation could work:

function checkEmail(email) {
    if (!email.includes('@') || !email.includes('.')) {
        alert('Please enter a valid email address');
        return false;
    }
    return true;
}

Steps to Test

  1. Go to the newsletter form
  2. Try entering these invalid emails:
    • "test@"
    • "test@test"
    • "test.com"
  3. Submit the form
  4. Check if you see any error messages

Expected Result

  • Invalid emails should show error message
  • Forms should not accept empty submissions
  • No data should appear in browser console

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions