Skip to content

User uploads proxied from S3 lack `Content-Security-Policy` headers, may be served with `Content-Disposition: inline`

Moderate
alexmv published GHSA-wm83-3764-5wqh Feb 7, 2023

Package

Zulip Server (Application)

Affected versions

main branch (2023-01-09)

Patched versions

main branch (2023-02-07)

Description

Impact

Users could upload files with arbitrary Content-Type which would be served from the Zulip hostname with Content-Disposition: inline and no Content-Security-Policy header, allowing them to trick other users into executing arbitrary Javascript in the context of the Zulip application. Among other things, this enables session theft.

Only deployments which use the S3 storage (not the local-disk storage) are affected, and only deployments which deployed 04cf68b (merged on January 9th), which has only been in main. This vulnerability does not affect any numbered release.

Workarounds

Switching from S3 storage to the local-disk storage would nominally mitigate this, but is likely more involved than upgrading to the latest main which addresses the issue.

Patches

The vulnerability was fixed in the main branch with commit 2f6c5a8. Users running a Zulip server from the main branch should upgrade from main again to deploy this fix.

Severity

Moderate

CVSS overall score

This score calculates overall vulnerability severity from 0 to 10 and is based on the Common Vulnerability Scoring System (CVSS).
/ 10

CVSS v3 base metrics

Attack vector
Network
Attack complexity
Low
Privileges required
Low
User interaction
Required
Scope
Changed
Confidentiality
Low
Integrity
Low
Availability
None

CVSS v3 base metrics

Attack vector: More severe the more the remote (logically and physically) an attacker can be in order to exploit the vulnerability.
Attack complexity: More severe for the least complex attacks.
Privileges required: More severe if no privileges are required.
User interaction: More severe when no user interaction is required.
Scope: More severe when a scope change occurs, e.g. one vulnerable component impacts resources in components beyond its security scope.
Confidentiality: More severe when loss of data confidentiality is highest, measuring the level of data access available to an unauthorized user.
Integrity: More severe when loss of data integrity is the highest, measuring the consequence of data modification possible by an unauthorized user.
Availability: More severe when the loss of impacted component availability is highest.
CVSS:3.1/AV:N/AC:L/PR:L/UI:R/S:C/C:L/I:L/A:N

CVE ID

CVE-2023-22735

Weaknesses