Attack ChainAIDerived
Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain
-
AccessAuthenticate as site admin on multisite instance
-
ExploitCraft backup dump with embedded psql meta-commands
-
ExecutionTrigger restore, meta-commands execute via psql
-
ImpactRead other tenants' data and credentials
Vulnerability Assessment
| Weakness |
CWE
OWASP Top 10:2025
A05:2025 - Injection
ASVS 5.0
V1 - Encoding and Sanitization Command injection prevention
MITRE ATT&CK
1 technique across 1 tactic: Execution The technique list with ATT&CK links and the kill-chain view is part of the Basic plan and up. |
| Exploitation Conditions | Exploitation requires (1) administrator privileges on at least one site, (2) a multisite Discourse deployment for the cross-site data/credential access that gives this bug its severity, and (3) the ability to supply a crafted database backup containing malicious PostgreSQL meta-commands that get executed when the restore pipeline pipes the dump into psql. The specific affected feature is the backup/restore database restorer (lib/backup_restore/database_restorer.rb) in Discourse 3.5.0 and below. Limiting factors: it is not remote-unauthenticated - it demands a pre-existing admin account (PR:H) and the deliberate act of restoring an attacker-controlled dump; on a single-site install the cross-tenant impact does not apply, so the realistic target population is shared/multisite hosting. |
| Impact | This is a genuine but not urgent issue, and the available signals are internally consistent rather than conflicting. The CVSS 4.0 vector (AV:N/AC:H/PR:H/UI:N) and the description agree: exploitation requires an authenticated administrator (PR:H), a high-complexity precondition (AC:H) in the form of a multisite deployment plus a specially crafted backup dump, and it is reachable over the network via the admin restore function. EPSS is 0.03% (10th percentile), the vulnerability is NOT on the CISA KEV list, and no public exploit was identified - all of which align with the modest 5.5 (Medium) base score. The notable nuance is the technical-impact split in the 4.0 vector: impact to the vulnerable system is low (VC:L, VI:N, VA:N) but subsequent-system impact is high across the board (SC:H/SI:H/SA:H) because, in multisite setups, one tenant admin can reach other tenants' data and credentials. In short, this is a legitimate privilege-boundary/tenant-isolation flaw for multisite operators, not a widely-exploitable internet-facing RCE. For single-site Discourse installs the practical risk is minimal (an admin attacking their own site); the real priority is for shared/multisite hosting providers, where the cross-tenant impact matters. |
| Exploit ScenarioDerived | A customer who holds administrator rights on one site of a shared multisite Discourse deployment crafts a database backup file with malicious PostgreSQL meta-commands embedded in it and triggers a restore. During the psql restore the embedded meta-commands execute, letting the attacker read data and credentials belonging to other sites hosted on the same instance. No public exploit code was identified, and the attack requires existing admin access plus the high-complexity multisite condition. |
Get an e-mail when this CVE is exploited, patched or re-scored. Free account.
Alert meAnalysisAIv2 – Oct 19, 2026
Discourse 3.5.0 and earlier allows an authenticated administrator to embed malicious PostgreSQL meta-commands in a backup dump that are executed when the dump is restored, and in multisite deployments this can expose data or credentials from other sites. The vendor fixed the issue in Discourse 3.5.1 by restricting psql meta-command execution during restore. EPSS is 0.03% (10th percentile), and no CISA KEV entry or public exploit code was identified at time of analysis.
Earlier versions of this analysis (1)
RemediationAI
Upgrade to Discourse 3.5.1 or later; the vendor advisory GHSA-7xjr-4f4g-9887 and upstream commit 43536b60d012cc8084e7e701d6afab9ba01e28a5 document the fix. The patch filters PostgreSQL \restrict/\unrestrict meta-commands and wraps restore input in a nonce-protected \restrict/\unrestrict block, so the restored dump cannot execute embedded psql meta-commands. If immediate upgrade is not possible, restrict backup restore rights to fully trusted administrators, avoid restoring backup dumps from untrusted or cross-site sources, and review dumps for unexpected backslash meta-commands before restore; these are compensating controls only and do not remove the underlying injection path. Also confirm the PostgreSQL client supports \restrict/\unrestrict if applying the fix or backporting it.
Affected VersionsENISA
Affected Packages
Source: OSV (Open Source Vulnerabilities)
Affects your stack
Affects 1 package in euvd
Checking this CVE against your own stacks and servers is part of the Basic plan and up.
Technical ContextAI · show details
The flaw is a command-injection class issue (CWE-77) in Discourse's backup/restore database restorer, specifically lib/backup_restore/database_restorer.rb, which pipes a PostgreSQL dump into psql for restore. PostgreSQL dump files can contain psql meta-commands (backslash commands), and prior to the fix a crafted dump could carry commands that the restore pipeline would execute with the database privileges of the Discourse restore process. In a multisite Discourse installation, an admin of one site who can supply a backup for restore could abuse this to reach other sites' data or credentials. The upstream commit 43536b60d012cc8084e7e701d6afab9ba01e28a5 adds filtering for \restrict and \unrestrict and wraps the restore input with a random-nonce PostgreSQL \restrict/\unrestrict pair, so embedded meta-commands in the dump cannot execute during psql restore. NVD CPE data enumerates Discourse stable and beta channels, including a 3.6.0 beta1 entry, while EUVD lists affected versions as discourse < 3.5.1.
Know when Discourse gets its next vulnerability
- Watch products and get an email when something new is published
- Check this CVE against your own stack and servers
- Exploit and PoC references, threat intelligence from 22 sources
No credit card · 7-day full trial
Severity by source
CVSS:4.0/AV:N/AC:H/AT:N/PR:H/UI:N/VC:L/VI:N/VA:N/SC:H/SI:H/SA:H
Admin-only (PR:H) over the network, requiring a crafted dump and multisite config (AC:H); restore breaks tenant isolation (S:C), exposing other sites' credentials (C:H) with limited integrity impact (I:L).
Primary rating from Vendor (github).
CVSS VectorVendor: github
Lifecycle Timeline
3DescriptionCVE.org
Discourse is an open-source community discussion platform. In versions 3.5.0 and below, malicious meta-commands could be embedded in a backup dump and executed during restore. In multisite setups, this allowed an admin of one site to access data or credentials from other sites. This issue is fixed in version 3.5.1.
Executive ViewAI
Organizations using Discourse should be aware of notable risk from CVE-2025-59337, a command injection vulnerability rated CVSS 6.8. Exploitation could allow attackers to execute code or inject malicious input. A patch is available and should be applied during regular vulnerability management.
Apply vendor patch. If patching is delayed: deploy WAF rules, restrict network access, enable logging.
Threat Intelligence Overview
How this decision was reached
The engine reads each signal below and applies a fixed list of rules from top to bottom. The first rule that matches sets the recommended action – like a statement, every line is shown.
What every action level means
SSVC AssessmentENISA
Priority Score
Attack Technique
OS command injection occurs when an application passes unsanitized user input directly into system shell commands.
Discourse versions prior to 3.5.0.beta6 contain a reflected cross-site scripting (XSS) vulnerability in social login fun
discourse-bbcode is the official BBCode plugin for Discourse. Rated critical severity (CVSS 9.8), this vulnerability is
Unauthorized information disclosure in Discourse discussion platform versions prior to 2026.3.0-latest.1, 2026.2.1, and
Discourse is an open source platform for community discussion. Rated high severity (CVSS 8.2), this vulnerability is rem
Discourse versions prior to 2025.12.2, 2026.1.1, and 2026.2.0 contain an insecure direct object reference (IDOR) in the
In Discourse 2.7.0 through beta1, a rate-limit bypass leads to a bypass of the 2FA requirement for certain forms. Rated
Unauthenticated attackers can submit forged webhook payloads to multiple email provider integrations in Discourse versio
Discourse is an open-source discussion platform. Rated medium severity (CVSS 6.5), this vulnerability is remotely exploi
Discourse is an open source platform for community discussion. Rated medium severity (CVSS 5.9), this vulnerability is r
Discourse versions prior to 3.4.4 (stable), 3.5.0.beta5 (beta), and 3.5.0.beta6-dev (tests-passed) contain a critical vu
Discourse is an open source platform for community discussion. Rated critical severity (CVSS 9.8), this vulnerability is
Discourse Patreon enables syncronization between Discourse Groups and Patreon rewards. Rated critical severity (CVSS 9.8
EUVD-2025-33221
NVD
CVE.org
EPSS
GitHub
Exploit-DB