Skip to main content

Discourse CVE-2025-59337

| EUVDEUVD-2025-33221 MEDIUM
Command Injection (CWE-77)
2025-10-01 security-advisories@github.com
5.5
CVSS 4.0 · Vendor: github
View

Attack ChainAIDerived

Hypothetical attack flow derived from CVE metadata – not a confirmed exploit chain

  1. Access
    Authenticate as site admin on multisite instance
  2. Exploit
    Craft backup dump with embedded psql meta-commands
  3. Execution
    Trigger restore, meta-commands execute via psql
  4. Impact
    Read 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.

This Month Plan within 30 days. Why: MEDIUM severity (CVSS 4.0-6.9).
Patch available 0.0% exploitation probability (EPSS)

Get an e-mail when this CVE is exploited, patched or re-scored. Free account.

Alert me

AnalysisAIv2 – 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)
v1 Mar 13, 2026 - 18:18 CVSS 6.8

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

discourse < 3.5.1

Affected Packages

euvd discourse fix: 3.5.1

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

Vendor (github) PRIMARY 5.5 MEDIUM
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
vuln.today AI 6.6 MEDIUM

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).

3.1 AV:N/AC:H/PR:H/UI:N/S:C/C:H/I:L/A:N
4.0 AV:N/AC:H/AT:N/PR:H/UI:N/VC:L/VI:N/VA:N/SC:H/SI:H/SA:H

Primary rating from Vendor (github).

CVSS VectorVendor: github

Attack Vector
Network
Attack Complexity
High
Attack Requirements
None
Privileges Required
High
User Interaction
None
Vulnerable system: Confidentiality
Low
Vulnerable system: Integrity
None
Vulnerable system: Availability
None
Subsequent system: Confidentiality
High
Subsequent system: Integrity
High
Subsequent system: Availability
High

Lifecycle Timeline

3
CVSS changed
Oct 19, 2026 - 17:23 NVD
6.8 (MEDIUM) 5.5 (MEDIUM)
Patch released
Oct 16, 2025 - 17:33 nvd
Patch available
CVE Published
Oct 01, 2025 - 21:16 nvd
MEDIUM 6.8

DescriptionCVE.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

Why It Matters

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.

Business Impact: Moderate
Compensating Controls

Apply vendor patch. If patching is delayed: deploy WAF rules, restrict network access, enable logging.

Threat Intelligence Overview

EPSS Score
0.0%
Top 90% exploitable
Prevalence
Medium
popular open-source forum platform, but multisite hosting is less common
Data Quality
5 sources
Confidence: Medium

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.

SignalValue
Severity MEDIUM
CISA KEV No
Public POC No
EPSS 0.0%
Patch available Yes
Active threat No
Deciding rule
MEDIUM severity (CVSS 4.0-6.9)
What every action level means
Emergency Immediate action required. Criteria: CRITICAL + in CISA KEV (actively exploited) without patch, OR CRITICAL + EPSS > 30% without patch, OR CRITICAL + active threat signals without patch.
Act Now Prioritize within 24-48h. Criteria: in KEV with patch available, OR CRITICAL + public POC, OR HIGH + EPSS > 10%, OR CRITICAL + active threat, OR any CRITICAL severity.
This Week Schedule remediation this week. Criteria: HIGH severity (CVSS 7.0-8.9). Patch within normal change window.
This Month Plan within 30 days. Criteria: MEDIUM severity (CVSS 4.0-6.9), lower exploitation probability. Include in regular patch cycle.
Monitor Track and reassess. Criteria: LOW severity (CVSS 0.1-3.9), minimal exploitation risk. No immediate action needed.

SSVC AssessmentENISA

Exploitation· derived
None
System Exposure· derived
Open
Automatable· derived
No

Priority Score

28
Low Medium High Critical
KEV: 0
EPSS: 0
CVSS: +28
PoC: 0
Weaponized: 0
Threat intel: 0
Gov advisory: 0

Attack Technique

OS command injection occurs when an application passes unsanitized user input directly into system shell commands.

CVE-2025-48954 HIGH POC
8.1 Jun 25

Discourse versions prior to 3.5.0.beta6 contain a reflected cross-site scripting (XSS) vulnerability in social login fun

CVE-2022-46162 CRITICAL POC
9.8 Nov 30

discourse-bbcode is the official BBCode plugin for Discourse. Rated critical severity (CVSS 9.8), this vulnerability is

CVE-2026-27934 HIGH POC
8.7 Mar 19

Unauthorized information disclosure in Discourse discussion platform versions prior to 2026.3.0-latest.1, 2026.2.1, and

CVE-2024-47773 HIGH POC
8.2 Oct 08

Discourse is an open source platform for community discussion. Rated high severity (CVSS 8.2), this vulnerability is rem

CVE-2026-26265 HIGH POC
7.5 Feb 26

Discourse versions prior to 2025.12.2, 2026.1.1, and 2026.2.0 contain an insecure direct object reference (IDOR) in the

CVE-2021-3138 HIGH POC
7.5 Jan 14

In Discourse 2.7.0 through beta1, a rate-limit bypass leads to a bypass of the 2FA requirement for certain forms. Rated

CVE-2026-26077 MEDIUM POC
6.5 Feb 26

Unauthenticated attackers can submit forged webhook payloads to multiple email provider integrations in Discourse versio

CVE-2023-38706 MEDIUM POC
6.5 Sep 15

Discourse is an open-source discussion platform. Rated medium severity (CVSS 6.5), this vulnerability is remotely exploi

CVE-2024-53991 MEDIUM POC
5.9 Dec 19

Discourse is an open source platform for community discussion. Rated medium severity (CVSS 5.9), this vulnerability is r

CVE-2025-48877 CRITICAL
9.8 Jun 09

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

CVE-2023-47121 CRITICAL
9.8 Nov 10

Discourse is an open source platform for community discussion. Rated critical severity (CVSS 9.8), this vulnerability is

CVE-2022-39355 CRITICAL
9.8 Oct 26

Discourse Patreon enables syncronization between Discourse Groups and Patreon rewards. Rated critical severity (CVSS 9.8

This site uses cookies essential for authentication and security. No tracking or analytics cookies are used. Privacy Policy