Skip to content
Heist/ feed
Back to feed
High

Security advisory

Type: advisorySources: OSVCVE: CVE-2021-21261

Flatpak is a system for building, distributing, and running sandboxed desktop applications on Linux. A bug was discovered in the `flatpak-portal` service that can allow sandboxed applications to execute arbitrary code on the host system (a sandbox escape). This sandbox-escape bug is present in versions from 0.11.4 and before fixed versions 1.8.5 and 1.10.0. The Flatpak portal D-Bus service (`flatpak-portal`, also known by its D-Bus service name `org.freedesktop.portal.Flatpak`) allows apps in a Flatpak sandbox to launch their own subprocesses in a new sandbox instance, either with the same security settings as the caller or with more restrictive security settings. For example, this is used in Flatpak-packaged web browsers such as Chromium to launch subprocesses that will process untrusted web content, and give those subprocesses a more restrictive sandbox than the browser itself. In vulnerable versions, the Flatpak portal service passes caller-specified environment variables to non-sandboxed processes on the host system, and in particular to the `flatpak run` command that is used to launch the new sandbox instance. A malicious or compromised Flatpak app could set environment variables that are trusted by the `flatpak run` command, and use them to execute arbitrary code that is not in a sandbox. As a workaround, this vulnerability can be mitigated by preventing the `flatpak-portal` service from starting, but that mitigation will prevent many Flatpak apps from working correctly

Products
Not specified
Affected versions
Not specified
Fixed versions
Not specified
CVEs
CVE-2021-21261
Confirmed fixed CVEs
Not specified
Updated in this feed
31 Oct 2026, 12:42 UTC · Revision 1

Source evidence

CVE-2021-21261

core-osv · Original source

Published 14 Jan 2021, 20:15 UTC

Flatpak is a system for building, distributing, and running sandboxed desktop applications on Linux. A bug was discovered in the `flatpak-portal` service that can allow sandboxed applications to execute arbitrary code on the host system (a sandbox escape). This sandbox-escape bug is present in versions from 0.11.4 and before fixed versions 1.8.5 and 1.10.0. The Flatpak portal D-Bus service (`flatpak-portal`, also known by its D-Bus service name `org.freedesktop.portal.Flatpak`) allows apps in a Flatpak sandbox to launch their own subprocesses in a new sandbox instance, either with the same security settings as the caller or with more restrictive security settings. For example, this is used in Flatpak-packaged web browsers such as Chromium to launch subprocesses that will process untrusted web content, and give those subprocesses a more restrictive sandbox than the browser itself. In vulnerable versions, the Flatpak portal service passes caller-specified environment variables to non-sandboxed processes on the host system, and in particular to the `flatpak run` command that is used to launch the new sandbox instance. A malicious or compromised Flatpak app could set environment variables that are trusted by the `flatpak run` command, and use them to execute arbitrary code that is not in a sandbox. As a workaround, this vulnerability can be mitigated by preventing the `flatpak-portal` service from starting, but that mitigation will prevent many Flatpak apps from working correctly

osv:CVE-2021-21261
Complete source record
{
  "id": "84a93e10a39a6dc7188ad876a171d76f1da0cee55c729328c3a64fd758a51f1a",
  "url": "https://osv.dev/vulnerability/CVE-2021-21261",
  "method": "structured",
  "payload": {
    "kind": "advisory",
    "title": "CVE-2021-21261",
    "summary": "Flatpak is a system for building, distributing, and running sandboxed desktop applications on Linux. A bug was discovered in the `flatpak-portal` service that can allow sandboxed applications to execute arbitrary code on the host system (a sandbox escape). This sandbox-escape bug is present in versions from 0.11.4 and before fixed versions 1.8.5 and 1.10.0. The Flatpak portal D-Bus service (`flatpak-portal`, also known by its D-Bus service name `org.freedesktop.portal.Flatpak`) allows apps in a Flatpak sandbox to launch their own subprocesses in a new sandbox instance, either with the same security settings as the caller or with more restrictive security settings. For example, this is used in Flatpak-packaged web browsers such as Chromium to launch subprocesses that will process untrusted web content, and give those subprocesses a more restrictive sandbox than the browser itself. In vulnerable versions, the Flatpak portal service passes caller-specified environment variables to non-sandboxed processes on the host system, and in particular to the `flatpak run` command that is used to launch the new sandbox instance. A malicious or compromised Flatpak app could set environment variables that are trusted by the `flatpak run` command, and use them to execute arbitrary code that is not in a sandbox. As a workaround, this vulnerability can be mitigated by preventing the `flatpak-portal` service from starting, but that mitigation will prevent many Flatpak apps from working correctly",
    "evidence": "osv:CVE-2021-21261",
    "products": [],
    "severity": "high",
    "structured": {
      "id": "CVE-2021-21261",
      "aliases": [
        "CVE-2021-21261",
        "GHSA-4ppf-fxf6-vxg2"
      ],
      "metrics": [
        {
          "type": "CVSS_V3",
          "score": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:H/I:H/A:H"
        }
      ],
      "affected": [
        {
          "ranges": [
            {
              "repo": "https://github.com/flatpak/flatpak",
              "type": "GIT",
              "events": [
                {
                  "introduced": "b5571fa0397d1ce0f1aaf9cf6bfe2e60cb90895d"
                },
                {
                  "fixed": "58dc0ea96c1648cdec341d7d74c260c3d62eb2bc"
                },
                {
                  "introduced": "d395763327116b3b04a8d6d4c33a24074700d2de"
                },
                {
                  "fixed": "649ad5fe49945b834da0d616a24400c41666048c"
                },
                {
                  "fixed": "6d1773d2a54dde9b099043f07a2094a4f1c2f486"
                },
                {
                  "fixed": "6e5ae7a109cdfa9735ea7ccbd8cb79f9e8d3ae8b"
                },
                {
                  "fixed": "aeb6a7ab0abaac4a8f4ad98b3df476d9de6b8bd4"
                },
                {
                  "fixed": "cc1401043c075268ecc652eac557ef8076b5eaba"
                }
              ],
              "database_specific": {
                "extracted_events": [
                  {
                    "cpe": "cpe:2.3:a:flatpak:flatpak:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "0.11.4"
                      },
                      {
                        "fixed": "1.8.5"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "cpe": "cpe:2.3:a:flatpak:flatpak:*:*:*:*:*:*:*:*",
                    "range": [
                      {
                        "introduced": "1.9.1"
                      },
                      {
                        "fixed": "1.10.0"
                      }
                    ],
                    "source": "CPE_RANGE"
                  },
                  {
                    "range": [
                      {
                        "fixed": "6d1773d2a54dde9b099043f07a2094a4f1c2f486"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  },
                  {
                    "range": [
                      {
                        "fixed": "6e5ae7a109cdfa9735ea7ccbd8cb79f9e8d3ae8b"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  },
                  {
                    "range": [
                      {
                        "fixed": "aeb6a7ab0abaac4a8f4ad98b3df476d9de6b8bd4"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  },
                  {
                    "range": [
                      {
                        "fixed": "cc1401043c075268ecc652eac557ef8076b5eaba"
                      }
                    ],
                    "source": "REFERENCES_COMMIT"
                  },
                  {
                    "range": [
                      {
                        "fixed": "58dc0ea96c1648cdec341d7d74c260c3d62eb2bc"
                      }
                    ],
                    "source": "REFERENCES_TAG",
                    "original_tag": "1.8.5"
                  }
                ]
              }
            }
          ],
          "versions": [
            "1.8.4",
            "1.9.3",
            "1.8.3",
            "1.9.2",
            "1.9.1",
            "1.8.2",
            "1.8.0",
            "1.7.3",
            "1.7.2",
            "1.7.1",
            "1.6.2",
            "1.6.1",
            "1.6.0",
            "1.5.2",
            "1.5.1",
            "1.5.0",
            "1.4.0",
            "1.3.4",
            "1.3.3",
            "1.3.2",
            "1.3.1",
            "1.3.0",
            "1.2.1",
            "1.2.0",
            "1.1.3",
            "1.1.2",
            "1.1.1",
            "1.1.0",
            "1.0.3",
            "1.0.2",
            "1.0.1",
            "1.0.0",
            "0.99.3",
            "0.99.2",
            "0.99.1",
            "0.11.8.3",
            "0.11.8.2",
            "0.11.8.1",
            "0.11.8",
            "0.11.7",
            "0.11.6",
            "0.11.5",
            "0.11.4"
          ],
          "database_specific": {
            "source": "https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-21261.json",
            "vanir_signatures": [
              {
                "id": "CVE-2021-21261-0548202b",
                "digest": {
                  "threshold": 0.9,
                  "line_hashes": [
                    "187884336905612395231330406807632357540",
                    "119966363514582499525315861909166376099",
                    "46012603303833455347858473125643287427",
                    "151763468982046354621867926977057407996",
                    "147841209049247011411836960548228474009",
                    "210586123448264467490491665920891689504"
                  ]
                },
                "source": "https://github.com/flatpak/flatpak/commit/6d1773d2a54dde9b099043f07a2094a4f1c2f486",
                "target": {
                  "file": "common/flatpak-bwrap.c"
                },
                "deprecated": false,
                "signature_type": "Line",
                "signature_version": "v1"
              },
              {
                "id": "CVE-2021-21261-2cb9cfb5",
                "digest": {
                  "threshold": 0.9,
                  "line_hashes": [
                    "168417353790797368165839907690445508493",
                    "327012681670393743305787150072641325411",
                    "23688458601150324176395771316217294730",
                    "49729934599472863566897555018543408450",
                    "9450908212238931453333786533088716078",
                    "184028996534785543118806081166217184330",
                    "141419741360300883951586041005272492896",
                    "206249337290032327518896842942263903489",
                    "90318883290108511492839356082770308365",
                    "12932935097118578644062154051992084777",
                    "144774528113192030728296602362033592877",
                    "79201547501775564610540632545667244027",
                    "268846712764991704531477048056715863846",
                    "278171116430610011995476595605264549622",
                    "198046183515048329716552688201140766062",
                    "186874874185981287271469462079034122186",
                    "256515148011437925207635412414066159130",
                    "3346186902999804577361326057752316291",
                    "254409286826292135473128319948286163718",
                    "141533511151258764870094348930568640143",
                    "259454807294067507133633282981503554384",
                    "191389743288879362348653886153241129053",
                    "194637151052508142939035967020326419871",
                    "205972780634195676094809405714121723252",
                    "23392054317266148780655332786943982622",
                    "34547951232220976726414035075532117100"
                  ]
                },
                "source": "https://github.com/flatpak/flatpak/commit/6d1773d2a54dde9b099043f07a2094a4f1c2f486",
                "target": {
                  "file": "common/flatpak-run.c"
                },
                "deprecated": false,
                "signature_type": "Line",
                "signature_version": "v1"
              },
              {
                "id": "CVE-2021-21261-33525b89",
                "digest": {
                  "length": 1224,
                  "function_hash": "116696172303620550801466906987719068366"
                },
                "source": "https://github.com/flatpak/flatpak/commit/aeb6a7ab0abaac4a8f4ad98b3df476d9de6b8bd4",
                "target": {
                  "file": "portal/flatpak-portal.c",
                  "function": "child_setup_func"
                },
                "deprecated": false,
                "signature_type": "Function",
                "signature_version": "v1"
              },
              {
                "id": "CVE-2021-21261-4a832f75",
                "digest": {
                  "threshold": 0.9,
                  "line_hashes": [
                    "181467856496703161714286787676753514560",
                    "262003444876501901294604323868568402193",
                    "150489235987664807730600990675707141516",
                    "308914679741222343840220446431887347020",
                    "22914194553643468080754179086792170796",
                    "294736744238137854585260502181037366798",
                    "257931896619599938072240305823517035948"
                  ]
                },
                "source": "https://github.com/flatpak/flatpak/commit/6e5ae7a109cdfa9735ea7ccbd8cb79f9e8d3ae8b",
                "target": {
                  "file": "common/flatpak-context.c"
                },
                "deprecated": false,
                "signature_type": "Line",
                "signature_version": "v1"
              },
              {
                "id": "CVE-2021-21261-89757ad9",
                "digest": {
                  "length": 4242,
                  "function_hash": "33047310530798657115268533786732258227"
                },
                "source": "https://github.com/flatpak/flatpak/commit/6d1773d2a54dde9b099043f07a2094a4f1c2f486",
                "target": {
                  "file": "common/flatpak-run.c",
                  "function": "flatpak_run_add_environment_args"
                },
                "deprecated": false,
                "signature_type": "Function",
                "signature_version": "v1"
              },
              {
                "id": "CVE-2021-21261-cc0442da",
                "digest": {
                  "length": 10642,
                  "function_hash": "121856444566269508847150148348225191560"
                },
                "source": "https://github.com/flatpak/flatpak/commit/6d1773d2a54dde9b099043f07a2094a4f1c2f486",
                "target": {
                  "file": "common/flatpak-run.c",
                  "function": "flatpak_run_app"
                },
                "deprecated": false,
                "signature_type": "Function",
                "signature_version": "v1"
              },
              {
                "id": "CVE-2021-21261-e4aba771",
                "digest": {
                  "threshold": 0.9,
                  "line_hashes": [
                    "186753914006100194516954110745550884424",
                    "12753299659279139043630104728458776064",
                    "269889525867134572535695503617087983501",
                    "208208283627142296061927458336690996509",
                    "180501221704741290327491119284995032025",
                    "176111972974236863265595961229486818247",
                    "96681180801602239017311502751839799173",
                    "198705453584377096480089798889685337457"
                  ]
                },
                "source": "https://github.com/flatpak/flatpak/commit/6d1773d2a54dde9b099043f07a2094a4f1c2f486",
                "target": {
                  "file": "common/flatpak-bwrap-private.h"
                },
                "deprecated": false,
                "signature_type": "Line",
                "signature_version": "v1"
              },
              {
                "id": "CVE-2021-21261-f081ded5",
                "digest": {
                  "threshold": 0.9,
                  "line_hashes": [
                    "250583380488175601669317137946174719794",
                    "311312556761816106744451561827799888308",
                    "296511374797103482356447941591751752716",
                    "163819300700743363828332066461507542872",
                    "256646176672544301483717845513293989867",
                    "283066343764066525662795773450547192544",
                    "307830766081670044218645905522083376346",
                    "314613757453546637160749133659371754136",
                    "33477874074197511545467797114432888206",
                    "217867266162192291486524756726822760936",
                    "40016216926295346927460055704050908419",
                    "202058260553356883764319272044505786272",
                    "232829783943157726400537389676411531144",
                    "142269808049044781331577504304469511031",
                    "228461531246778135043747909129711248394",
                    "158813393187993092148429072759724546882"
                  ]
                },
                "source": "https://github.com/flatpak/flatpak/commit/aeb6a7ab0abaac4a8f4ad98b3df476d9de6b8bd4",
                "target": {
                  "file": "portal/flatpak-portal.c"
                },
                "deprecated": false,
                "signature_type": "Line",
                "signature_version": "v1"
              },
              {
                "id": "CVE-2021-21261-f0f82716",
                "digest": {
                  "length": 14396,
                  "function_hash": "138027983890393511308692566048484423621"
                },
                "source": "https://github.com/flatpak/flatpak/commit/aeb6a7ab0abaac4a8f4ad98b3df476d9de6b8bd4",
                "target": {
                  "file": "portal/flatpak-portal.c",
                  "function": "handle_spawn"
                },
                "deprecated": false,
                "signature_type": "Function",
                "signature_version": "v1"
              }
            ],
            "vanir_signatures_modified": "2026-10-20T14:15:20Z"
          }
        }
      ],
      "modified": "2026-10-20T14:15:20.971945227Z",
      "provider": "osv",
      "references": [
        "https://github.com/flatpak/flatpak/commit/cc1401043c075268ecc652eac557ef8076b5eaba",
        "https://github.com/flatpak/flatpak/releases/tag/1.8.5",
        "https://github.com/flatpak/flatpak/security/advisories/GHSA-4ppf-fxf6-vxg2",
        "https://security.gentoo.org/glsa/202101-21",
        "https://www.debian.org/security/2021/dsa-4830",
        "https://github.com/flatpak/flatpak/commit/6d1773d2a54dde9b099043f07a2094a4f1c2f486",
        "https://github.com/flatpak/flatpak/commit/6e5ae7a109cdfa9735ea7ccbd8cb79f9e8d3ae8b",
        "https://github.com/flatpak/flatpak/commit/aeb6a7ab0abaac4a8f4ad98b3df476d9de6b8bd4"
      ],
      "provider_metadata": {
        "unresolved_ranges": [
          {
            "cpes": [
              "cpe:2.3:o:debian:debian_linux:10.0:*:*:*:*:*:*:*"
            ],
            "vendor_product": "debian:debian_linux",
            "extracted_events": [
              {
                "range": [
                  {
                    "introduced": "10.0"
                  },
                  {
                    "last_affected": "10.0"
                  }
                ],
                "source": "CPE_STRING"
              }
            ]
          }
        ]
      }
    },
    "related_cves": [
      {
        "value": "CVE-2021-21261",
        "evidence": "/id"
      }
    ],
    "security_relevant": true,
    "severity_evidence": "/severity/0/score"
  },
  "source_id": "core-osv",
  "document_id": 388772,
  "published_at": "2021-01-14T20:15:12.36+00:00"
}