Skip to content

Unencoded email in the API request plus fail-open error handling lets registrants bypass validation entirely #3

Description

@bonelifer

Had Claude trace how the submitted email reaches the MailboxValidator API and what happens on failure, and found two things that combine into a full bypass.

First, every API call builds its URL like this, with no urlencode():

$url = 'https://api.mailboxvalidator.com/v2/validation/single?key=' . str_replace(' ','',$api_key) . '&email=' . str_replace(' ','',$emailAddress) . '&source=phpbb';

& is a valid character in an email's local part (RFC 5322 permits it unquoted), so a registrant can submit something like evil&key=x@example.com and inject an extra query parameter into the real API request, or in some server-side parsers, override the site's own key= value.

Second, every failure path in event/main_listener.php fails open: phpbb_mbv_single() returns true (valid) on any exception or empty response, phpbb_mbv_is_valid_email() returns true if the API response contains an error key, and phpbb_mbv_is_free()/phpbb_mbv_is_disposable() return false (meaning "not free"/"not disposable") in the same situation.

Put together: anyone who wants to register with a disposable or free email just needs an & in the local part to corrupt the outbound API call into an error response, and the fail-open logic lets the registration through, defeating the extension's entire purpose for anyone who tries.

A fix needs both pieces: urlencode() the email and API key before building the URL, and decide deliberately whether validation failures should block registration (fail closed, safer default, with a clear error message) or only skip the specific check that failed rather than treating a broken request as "valid."

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions