CVE-2024-25108: Pixelfed/pixelfed Pixelfed Doesn't Check OAuth Scopes Vulnerability

CRITICAL
Advisory Identifier: GHSA-gccq-h3xj-jgvf
CVSS 9.9
CWE-285 CWE-863 CWE-280
Published
Advisory Summary

CVE-2024-25108 is a CRITICAL (CVSS 9.9) pixelfed doesn't check oauth scopes vulnerability (CWE-285: Improper Authorization) affecting Pixelfed/pixelfed libraries in the Packagist ecosystem. The issue involves pixelfed doesn't check oauth scopes in api routes, giving elevated permissions. Remediation is available by upgrading affected packages to version 0.11.11.

CVE-2024-25108 at a Glance

CVE Identifier CVE-2024-25108
GHSA Identifier GHSA-gccq-h3xj-jgvf
Severity CRITICAL
CVSS v3.1 Base Score 9.9
CWE Classification CWE-285: Improper Authorization
Affected Product Pixelfed/pixelfed
Package Ecosystem Packagist
Published Date
Last Updated

Security Impact

CVSS: 9.9

The security impact metrics below are parsed directly from the CVSS v3.1 vector string (CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:L/A:L).

Attack Vector Network (AV:N)
Attack Complexity Low (AC:L)
Privileges Required None (PR:N)
User Interaction None (UI:N)
Scope Changed (S:C)
Confidentiality High (C:H)
Integrity Low (I:L)
Availability Low (A:L)

How to Fix CVE-2024-25108

To remediate this vulnerability, upgrade all affected Pixelfed/pixelfed dependencies to a patched release. Both direct and transitive dependencies should be checked, as frameworks or security libraries may pull in vulnerable versions transitively.

pixelfed/pixelfed fixed: 0.11.11
Upgrade pixelfed/pixelfed to 0.11.11
Verify Direct and Transitive Dependencies

Run the following command in your project directory to verify that all resolved dependencies use the patched release:

inspect dependencies for pixelfed/pixelfed

How to Check if You Are Affected

To determine whether your application is affected by CVE-2024-25108, inspect your project dependencies for Pixelfed/pixelfed:

inspect dependencies for pixelfed/pixelfed

Analyze the terminal output to locate any version of Pixelfed/pixelfed in your dependency tree. If any resolved version matches the vulnerable ranges listed in the table below (for example, versions earlier than 0.11.11), your application is affected.

Note: Verify declared build manifests and deployed runtime container environments.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-285: Improper Authorization, where the product does not perform or incorrectly performs an authorization check when an actor attempts to access a resource or perform an action. In Pixelfed/pixelfed, software state validation or input boundaries are circumvented during processing. Review the official source advisory statement below for specific affected components, classes, and reproduction details.

Source Advisory Statement

### Summary When processing requests authorization was improperly and insufficiently checked, allowing attackers to access far more functionality than users intended, including to the administrative and moderator functionality of the Pixelfed server. This vulnerability affects every version of Pixelfed between `v0.10.4` and `v0.11.9`, inclusive. A proof of concept of this vulnerability exists. ### Details In vulnerable versions of Pixelfed (versions before 0.11.11), when the API checked the request for permissions to perform a certain behavior, it did not check that the OAuth Application/Client had granted access to those API endpoints, it only checked if the user was authenticated via an access token, and if the user was the owner of the resource or an admin on the instance. This meant that an attacker could request an access token for "read" permissions to authenticate you with their application, but the access token that they obtained actually could be used for "write" or even administrative actions, and the user who granted access to their account had zero knowledge of this elevated access. #### Proof of Concept 1. Create an access token either via [2-legged OAuth flow](https://oauth.net/2/grant-types/authorization-code/) for the `read` scope, or create a Personal Access Tokens with the `read` scope. 2. Using that Access Token, perform a request that would need a particular higher-privilege scope, for instance, following a user or performing an administrative request. (respectively requiring `follow` or `admin:read` and `admin:write` scopes in the patched versions) 3. Observe that despite your access token having `read` permissions, the follow or administrative request was successful. e.g., Maybe an attacker collects an access token (which expires in 1 year) wants to do something really nasty to an admin, such as disabling federation on their target's pixelfed server. As long as that server has `instance.enable_cc` configured (defaults to `true`), then the attacker can use the `read` scoped access token and perform the following request: ``` POST /api/admin/config/update Content-Type: application/json Accept: application/json Authorization: Bearer <access token with read scope> { "key": "federation.activitypub.enabled": "value": false } ``` And federation of that pixelfed server would be subsequently disabled, as if the administrator had disabled it. ### Impact This vulnerability affects every local user of a Pixelfed server, and can potentially affect the servers' ability to federate. Some user interaction is required to setup the conditions to be able to exercise the vulnerability, but the attacker could conduct this attack time-delayed manner, where user interaction is not actively required, since access tokens in Pixelfed have a 1-year lifetime before they expire, and users' often forget to revoke access tokens for applications that they are no longer using. This also means that Access Tokens that may have been leaked from third-party OAuth Application's databases would be usable for a significant amount of time by potential attackers. ### Prior versions Whilst this vulnerability is listed as `>= 0.10.4`, there is potential that versions before `0.10.4` are also vulnerable to this sort of security bypass, however, given that the code changed significantly between `0.10.3` and `0.10.4` we've been unable to easily assess if these heavily outdated versions are vulnerable or not to this exploit. ### Sponsorship The work involved in investigating and remediation of this security vulnerability was provided by [Nivenly Foundation](https://nivenly.org/), for whom we are grateful for their support of the Fediverse and Pixelfed.

CVE-2024-25108 Affected Pixelfed/pixelfed Versions

1 component(s)
Fixed Versions:
0.11.11
Product / Package Ecosystem Affected Versions Fixed Version
pixelfed/pixelfed
Packagist
≥ 0.10.4
< 0.11.11
0.11.11

References

Frequently Asked Questions

What is CVE-2024-25108?
CVE-2024-25108 is a security vulnerability in Pixelfed/pixelfed involving Pixelfed doesn't check OAuth Scopes in API routes, giving elevated permissions under CWE-285: Improper Authorization.
Which Pixelfed/pixelfed versions are affected?
Affected versions include releases prior to 0.11.11 across affected packages: pixelfed/pixelfed.
What version fixes CVE-2024-25108?
Upgrading to 0.11.11 (or the latest patched release for your respective branch) resolves the vulnerability.
Is pixelfed/pixelfed affected?
Yes, pixelfed/pixelfed is affected in releases prior to 0.11.11. Upgrade your dependency to 0.11.11 or later.
What is the CVSS score of CVE-2024-25108?
CVE-2024-25108 has a CVSS v3.1 base score of 9.9 (CRITICAL) with vector string CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:L/A:L.
What CWE is associated with CVE-2024-25108?
CVE-2024-25108 is classified under CWE-285: Improper Authorization (The product does not perform or incorrectly performs an authorization check when an actor attempts to access a resource or perform an action.).
How can I check Packagist dependencies for CVE-2024-25108?
Run the dependency tree command: 'inspect dependencies for pixelfed/pixelfed'. This command lists direct and transitive dependencies in your build configuration so you can verify if a vulnerable version is resolved.
Machine-readable OSV JSON OSV v1.5 Schema
Normalized schema output
{
  "schema_version" : "1.4.0",
  "id" : "GHSA-gccq-h3xj-jgvf",
  "modified" : "2024-10-11T21:35:07Z",
  "published" : "2024-02-12T15:17:23Z",
  "aliases" : [ "CVE-2024-25108" ],
  "summary" : "Pixelfed doesn't check OAuth Scopes in API routes, giving elevated permissions",
  "details" : "### Summary\n\nWhen processing requests authorization was improperly and insufficiently checked, allowing attackers to access far more functionality than users intended, including to the administrative and moderator functionality of the Pixelfed server.\n\nThis vulnerability affects every version of Pixelfed between `v0.10.4` and `v0.11.9`, inclusive. A proof of concept of this vulnerability exists.\n\n### Details\n\nIn vulnerable versions of Pixelfed (versions before 0.11.11), when the API checked the request for permissions to perform a certain behavior, it did not check that the OAuth Application/Client had granted access to those API endpoints, it only checked if the user was authenticated via an access token, and if the user was the owner of the resource or an admin on the instance.\n\nThis meant that an attacker could request an access token for \"read\" permissions to authenticate you with their application, but the access token that they obtained actually could be used for \"write\" or even administrative actions, and the user who granted access to their account had zero knowledge of this elevated access.\n\n#### Proof of Concept\n\n1. Create an access token either via [2-legged OAuth flow](https://oauth.net/2/grant-types/authorization-code/) for the `read` scope, or create a Personal Access Tokens with the `read` scope.\n2. Using that Access Token, perform a request that would need a particular higher-privilege scope, for instance, following a user or performing an administrative request. (respectively requiring `follow` or `admin:read` and `admin:write` scopes in the patched versions)\n3. Observe that despite your access token having `read` permissions, the follow or administrative request was successful.\n\ne.g., Maybe an attacker collects an access token (which expires in 1 year) wants to do something really nasty to an admin, such as disabling federation on their target's pixelfed server. As long as that server has `instance.enable_cc` configured (defaults to `true`), then the attacker can use the `read` scoped access token and perform the following request:\n\n```\nPOST /api/admin/config/update\nContent-Type: application/json\nAccept: application/json\nAuthorization: Bearer <access token with read scope>\n\n{ \"key\": \"federation.activitypub.enabled\": \"value\": false }\n```\n\nAnd federation of that pixelfed server would be subsequently disabled, as if the administrator had disabled it.\n\n### Impact\n\nThis vulnerability affects every local user of a Pixelfed server, and can potentially affect the servers' ability to federate.\n\nSome user interaction is required to setup the conditions to be able to exercise the vulnerability, but the attacker could conduct this attack time-delayed manner, where user interaction is not actively required, since access tokens in Pixelfed have a 1-year lifetime before they expire, and users' often forget to revoke access tokens for applications that they are no longer using.\n\nThis also means that Access Tokens that may have been leaked from third-party OAuth Application's databases would be usable for a significant amount of time by potential attackers.\n\n### Prior versions\n\nWhilst this vulnerability is listed as `>= 0.10.4`, there is potential that versions before `0.10.4` are also vulnerable to this sort of security bypass, however, given that the code changed significantly between `0.10.3` and `0.10.4` we've been unable to easily assess if these heavily outdated versions are vulnerable or not to this exploit.\n\n### Sponsorship\n\nThe work involved in investigating and remediation of this security vulnerability was provided by [Nivenly Foundation](https://nivenly.org/), for whom we are grateful for their support of the Fediverse and Pixelfed.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:C/C:H/I:L/A:L"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "Packagist",
      "name" : "pixelfed/pixelfed"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0.10.4"
      }, {
        "fixed" : "0.11.11"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "WEB",
    "url" : "https://github.com/pixelfed/pixelfed/security/advisories/GHSA-gccq-h3xj-jgvf"
  }, {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2024-25108"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pixelfed/pixelfed/commit/7e47d6dccb0393a2e95c42813c562c854882b037"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pixelfed/pixelfed/commit/fd7f5dbb"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pixelfed/pixelfed/commit/fd7f5dbba13818f60d1c2b3ab110b499e996aa81"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/pixelfed/pixelfed"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-280", "CWE-285", "CWE-863" ],
    "severity" : "CRITICAL",
    "github_reviewed" : true,
    "github_reviewed_at" : "2024-02-12T15:17:23Z",
    "nvd_published_at" : "2024-02-12T20:15:08Z"
  }
}