usd-2020-0049 | Gophish v0.10.1

Advisory ID: usd-2020-0049
CVE Number: CVE-2020-24709
Affected Product: Gophish
Affected Version: v0.10.1
Vulnerability Type: Stored Cross-Site Scripting
Security Risk: Medium
Vendor URL: https://getgophish.com/
Vendor Status: Fixed

Description

The preview feature of the HTML editor in Landing Pages > New Landing Page allows for execution of XSS payloads that are injected into the source text area. The XSS gets stored when saving a page. A rogue user could exploit an admin by asking him to impersonate him and preview his broken Landing Page.

Additionally, the preview feature of the HTML editor in Email Templates > New Template allows for execution of XSS payloads that are injected into the source text area. The XSS gets stored when saving a template. A rogue user could exploit an admin by asking him to impersonate him and preview his broken email template.

Proof of Concept (PoC)

On the landing page

As a user, create a new landing page (/landing_pages) include a XSS payload. Click the editor’s „preview“ button and observe that the JavaScript is executed

Email template

As a user, create a new email template (/template) include a XSS payload.
Click the editor’s „preview“ button and observe that the JavaScript is executed

An XSS vulnerability can be exploited in various ways. A common attack is to steal sensitive information
from the user and secretly transmit it to the attacker. The gophish session cookie is protected with the
HttpOnly flag and the page does not accept TRACE or TRACK requests. However it might be possible
for an attacker to perform actions with the rights of the user.

Fix

It is recommended to treat all input on the website as potentially dangerous. Hence, all output that is dynamically generated based on user-controlled data should be encoded according to its context. The majority of programming languages support standard procedures for encoding meta characters. For example, PHP has the built-in function htmlspecialchars().
Additionally, all input should be validated on the server-side. Where possible, whitelist filters should be used. The more restrictive a filter can be specified, the better the protection it provides. Whitelisting is especially recommended if input values have a well defined format or a list of valid input values exists. Invalid values should not be sanitized and forwarded to the application. Instead, requests with invalid values should be rejected.

Timeline

  • 2020-06-18 First contact request via security@getgophish.com
  • 2020-06-22 Vendor responds to initial contact
  • 2020-08-07 Vendor publishes a fix
  • 2020-09-29 Security advisory released

Credits

This security vulnerability was found by Marcus Nilsson of usd AG

ABOUT usd SECURITY ADVISORIES

In order to protect businesses against hackers and criminals, we always have to keep our skills and knowledge up to date. Thus, security research is just as important for our work as is building up a security community to promote the exchange of knowledge. After all, more security can only be achieved if many individuals take on the task.

Our CST Academy and our usd HeroLab are essential parts of our security mission. We share the knowledge we gain in our practical work and our research through training courses and publications. In this context, the usd HeroLab publishes a series of papers on new vulnerabilities and current security issues.

Always for the sake of our mission: „more security.“

to usd AG


In accordance with usd AG’s Responsible Disclosure Policy, all vendors have been notified of the existence of these vulnerabilities.

Disclaimer

The information provided in this security advisory is provided „as is“ and without warranty of any kind. Details of this security advisory may be updated in order to provide as accurate information as possible.