CVE-2021-47935: Sentry Superusers Can Execute Arbitrary Commands Vulnerability

HIGH
Advisory Identifier: GHSA-444r-2whx-3685
CVSS 8.8
CWE-94
Published
Advisory Summary

CVE-2021-47935 is a HIGH (CVSS 8.8) superusers can execute arbitrary commands vulnerability (CWE-94: Improper Control of Generation of Code ('Code Injection')) affecting Sentry libraries in the PyPI ecosystem. The issue involves superusers can execute arbitrary commands by injecting malicious pickle-serialized objects through audit log entry data parameter. Remediation is available by upgrading affected packages to version 8.1.4, 8.2.2.

CVE-2021-47935 at a Glance

CVE Identifier CVE-2021-47935
GHSA Identifier GHSA-444r-2whx-3685
Severity HIGH
CVSS v3.1 Base Score 8.8
CWE Classification CWE-94: Improper Control of Generation of Code ('Code Injection')
Affected Product Sentry
Package Ecosystem PyPI
Published Date
Last Updated

Security Impact

CVSS: 8.8

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

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

How to Fix CVE-2021-47935

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

sentry fixed: 8.1.4
pip install sentry>=8.1.4
sentry fixed: 8.2.2
pip install sentry>=8.2.2
Verify Direct and Transitive Dependencies

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

pip show sentry

How to Check if You Are Affected

To determine whether your Python environment is affected by CVE-2021-47935, inspect your installed packages using pip:

pip show sentry

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

Note: The pip show sentry command checks currently installed packages in your active Python environment.

Technical Details

Vulnerability Mechanism & Technical Analysis

This vulnerability is classified under CWE-94: Improper Control of Generation of Code ('Code Injection'), where the product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment. In Sentry, 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

Sentry 8.2.0 contains a remote code execution vulnerability that allows authenticated superusers to execute arbitrary commands by injecting malicious pickle-serialized objects through the audit log entry data parameter. Attackers can submit crafted POST requests to the admin audit log endpoint with base64-encoded compressed pickle payloads in the data field to achieve code execution with application privileges.

CVE-2021-47935 Affected Sentry Versions

2 component(s)
Fixed Versions:
8.1.48.2.2
Product / Package Ecosystem Affected Versions Fixed Version
sentry
PyPI
< 8.1.4
8.1.4
sentry
PyPI
≥ 8.2.0
< 8.2.2
8.2.2

References

Frequently Asked Questions

What is CVE-2021-47935?
CVE-2021-47935 is a security vulnerability in Sentry involving Superusers can execute arbitrary commands by injecting malicious pickle-serialized objects through audit log entry data parameter under CWE-94: Improper Control of Generation of Code ('Code Injection').
Which Sentry versions are affected?
Affected versions include releases prior to 8.1.4, 8.2.2 across affected packages: sentry.
What version fixes CVE-2021-47935?
Upgrading to 8.1.4, 8.2.2 (or the latest patched release for your respective branch) resolves the vulnerability.
Is sentry affected?
Yes, sentry is affected in releases prior to 8.1.4, 8.2.2. Upgrade your dependency to 8.1.4, 8.2.2 or later.
What is the CVSS score of CVE-2021-47935?
CVE-2021-47935 has a CVSS v3.1 base score of 8.8 (HIGH) with vector string CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H.
What CWE is associated with CVE-2021-47935?
CVE-2021-47935 is classified under CWE-94: Improper Control of Generation of Code ('Code Injection') (The product constructs all or part of a code segment using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the syntax or behavior of the intended code segment.).
How can I check PyPI dependencies for CVE-2021-47935?
Run the dependency tree command: 'pip show sentry'. 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-444r-2whx-3685",
  "modified" : "2026-06-09T20:49:59Z",
  "published" : "2026-05-10T15:31:19Z",
  "aliases" : [ "CVE-2021-47935" ],
  "summary" : "Sentry: Superusers can execute arbitrary commands by injecting malicious pickle-serialized objects through audit log entry data parameter",
  "details" : "Sentry 8.2.0 contains a remote code execution vulnerability that allows authenticated superusers to execute arbitrary commands by injecting malicious pickle-serialized objects through the audit log entry data parameter. Attackers can submit crafted POST requests to the admin audit log endpoint with base64-encoded compressed pickle payloads in the data field to achieve code execution with application privileges.",
  "severity" : [ {
    "type" : "CVSS_V3",
    "score" : "CVSS:3.1/AV:N/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H"
  }, {
    "type" : "CVSS_V4",
    "score" : "CVSS:4.0/AV:N/AC:L/AT:N/PR:L/UI:N/VC:H/VI:H/VA:H/SC:N/SI:N/SA:N"
  } ],
  "affected" : [ {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "sentry"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "0"
      }, {
        "fixed" : "8.1.4"
      } ]
    } ]
  }, {
    "package" : {
      "ecosystem" : "PyPI",
      "name" : "sentry"
    },
    "ranges" : [ {
      "type" : "ECOSYSTEM",
      "events" : [ {
        "introduced" : "8.2.0"
      }, {
        "fixed" : "8.2.2"
      } ]
    } ]
  } ],
  "references" : [ {
    "type" : "ADVISORY",
    "url" : "https://nvd.nist.gov/vuln/detail/CVE-2021-47935"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/getsentry/sentry/commit/19a0ba63d9ffb6aff79c7b78e2fa951a94edd61a"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/getsentry/sentry/commit/1f6090dc64b237c3da22bf35a5863a7136ac4669"
  }, {
    "type" : "PACKAGE",
    "url" : "https://github.com/getsentry/sentry"
  }, {
    "type" : "WEB",
    "url" : "https://github.com/pypa/advisory-database/tree/main/vulns/sentry/PYSEC-2026-131.yaml"
  }, {
    "type" : "WEB",
    "url" : "https://sentry.io/welcome"
  }, {
    "type" : "WEB",
    "url" : "https://www.exploit-db.com/exploits/50318"
  }, {
    "type" : "WEB",
    "url" : "https://www.vulncheck.com/advisories/sentry-remote-code-execution-via-pickle-deserialization"
  } ],
  "database_specific" : {
    "cwe_ids" : [ "CWE-94" ],
    "severity" : "HIGH",
    "github_reviewed" : true,
    "github_reviewed_at" : "2026-06-09T20:49:59Z",
    "nvd_published_at" : "2026-05-10T13:16:29Z"
  }
}