Ecosyste.ms: Advisories

An open API service providing security vulnerability metadata for many open source software ecosystems.

Security Advisories: GSA_kwCzR0hTQS0ydmpxLWhnNXctNWdtN84AA8EL

OctoPrint has an Authentication Bypass via X-Forwarded-For Header when autologinLocal is enabled

Impact

OctoPrint versions up until and including 1.10.0 contain a vulnerability that allows an unauthenticated attacker to completely bypass the authentication if the autologinLocal option is enabled within config.yaml, even if they come from networks that are not configured as localNetworks, by spoofing their IP via the X-Forwarded-For header.

If autologin is not enabled, this vulnerability does not have any impact.

Patches

The vulnerability has been patched in version 1.10.1.

Workaround

Until the patch has been applied, OctoPrint administrators who have autologin enabled on their instances should disable it and/or to make the instance inaccessible from potentially hostile networks like the internet.

PoC

  1. Enable the autologinAs configuration within the accessControl section in the OctoPrint yaml configuration file
  2. Set your browser to add the X-Forwarded-For: 127.0.0.1 header to HTTP requests. For example, this can be done using proxy software like Burp Suite. Alternatively, there are browser extensions such as https://github.com/MisterPhilip/x-forwarded-for, but I haven't tried them.
  3. Navigate to OctoPrint and note that it logs you in automatically.

Credits

This vulnerability was discovered and responsibly disclosed to OctoPrint by Jacopo Tediosi.

Permalink: https://github.com/advisories/GHSA-2vjq-hg5w-5gm7
JSON: https://advisories.ecosyste.ms/api/v1/advisories/GSA_kwCzR0hTQS0ydmpxLWhnNXctNWdtN84AA8EL
Source: GitHub Advisory Database
Origin: Unspecified
Severity: High
Classification: General
Published: 5 months ago
Updated: 5 months ago


CVSS Score: 7.1
CVSS vector: CVSS:3.1/AV:A/AC:H/PR:N/UI:N/S:U/C:H/I:H/A:L

Identifiers: GHSA-2vjq-hg5w-5gm7, CVE-2024-32977
References: Repository: https://github.com/OctoPrint/OctoPrint
Blast Radius: 5.5

Affected Packages

pypi:OctoPrint
Dependent packages: 1
Dependent repositories: 6
Downloads: 9,543 last month
Affected Version Ranges: <= 1.10.0
Fixed in: 1.10.1
All affected versions: 1.3.11, 1.3.12, 1.4.0, 1.4.1, 1.4.2, 1.5.0, 1.5.1, 1.5.2, 1.5.3, 1.6.0, 1.6.1, 1.7.0, 1.7.1, 1.7.2, 1.7.3, 1.8.0, 1.8.1, 1.8.2, 1.8.3, 1.8.4, 1.8.5, 1.8.6, 1.8.7, 1.9.0, 1.9.1, 1.9.2, 1.9.3, 1.10.0
All unaffected versions: 1.10.1, 1.10.2