You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
SQL injection in the contact duplicate-email check #402
isValid() checks the address with FILTER_VALIDATE_EMAIL, but that filter accepts characters such as ' in the part before the @. An address with an apostrophe (a legitimate one like o'[email protected], or a crafted one) breaks the query or changes it. Anyone who can create contacts can reach this, and contacts are created for new users too.
The v5.0 release fixed the same pattern in the public sign-up form; this one is in the model.
Fix: quote the value ($q->quote($this->contact_email)) or build the condition with w2p_Database_Query and addWhere() on a quoted value. A search for other loadAll(..., "... = '" . $value . "'") calls would be worthwhile.
Activity
Contacts: quote the e-mail address in the duplicate check