CVE-2021-43860

Source
https://nvd.nist.gov/vuln/detail/CVE-2021-43860
Import Source
https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2021-43860.json
JSON Data
https://api.osv.dev/v1/vulns/CVE-2021-43860
Downstream
Related
Published
2022-01-12T22:15:07.977Z
Modified
2025-11-20T11:57:20.133324Z
Severity
  • 8.6 (High) CVSS_V3 - CVSS:3.1/AV:L/AC:L/PR:N/UI:R/S:C/C:H/I:H/A:H CVSS Calculator
Summary
[none]
Details

Flatpak is a Linux application sandboxing and distribution framework. Prior to versions 1.12.3 and 1.10.6, Flatpak doesn't properly validate that the permissions displayed to the user for an app at install time match the actual permissions granted to the app at runtime, in the case that there's a null byte in the metadata file of an app. Therefore apps can grant themselves permissions without the consent of the user. Flatpak shows permissions to the user during install by reading them from the "xa.metadata" key in the commit metadata. This cannot contain a null terminator, because it is an untrusted GVariant. Flatpak compares these permissions to the actual metadata, from the "metadata" file to ensure it wasn't lied to. However, the actual metadata contents are loaded in several places where they are read as simple C-style strings. That means that, if the metadata file includes a null terminator, only the content of the file from before the terminator gets compared to xa.metadata. Thus, any permissions that appear in the metadata file after a null terminator are applied at runtime but not shown to the user. So maliciously crafted apps can give themselves hidden permissions. Users who have Flatpaks installed from untrusted sources are at risk in case the Flatpak has a maliciously crafted metadata file, either initially or in an update. This issue is patched in versions 1.12.3 and 1.10.6. As a workaround, users can manually check the permissions of installed apps by checking the metadata file or the xa.metadata key on the commit metadata.

References

Affected packages

Git / github.com/flatpak/flatpak

Affected versions

0.*

0.1
0.10.0
0.10.1
0.10.2
0.11.1
0.11.2
0.11.3
0.11.4
0.11.5
0.11.6
0.11.7
0.11.8
0.11.8.1
0.11.8.2
0.11.8.3
0.2
0.2.1
0.3
0.3.1
0.3.2
0.3.3
0.3.4
0.3.5
0.3.6
0.4.0
0.4.1
0.4.10
0.4.11
0.4.12
0.4.13
0.4.2
0.4.2.1
0.4.3
0.4.4
0.4.5
0.4.6
0.4.7
0.4.8
0.4.9
0.5.0
0.5.1
0.5.2
0.6.0
0.6.1
0.6.10
0.6.11
0.6.12
0.6.13
0.6.14
0.6.2
0.6.3
0.6.4
0.6.5
0.6.6
0.6.7
0.6.8
0.6.9
0.8.0
0.8.1
0.9.1
0.9.10
0.9.11
0.9.12
0.9.2
0.9.3
0.9.4
0.9.5
0.9.6
0.9.7
0.9.8
0.9.9
0.9.98
0.9.98.1
0.9.98.2
0.9.99
0.99.1
0.99.2
0.99.3

1.*

1.0.0
1.0.1
1.0.2
1.0.3
1.1.0
1.1.1
1.1.2
1.1.3
1.10.0
1.10.1
1.10.2
1.10.3
1.10.4
1.10.5
1.11.1
1.11.2
1.11.3
1.12.0
1.12.1
1.12.2
1.2.0
1.2.1
1.3.0
1.3.1
1.3.2
1.3.3
1.3.4
1.4.0
1.5.0
1.5.1
1.5.2
1.6.0
1.6.1
1.6.2
1.7.1
1.7.2
1.7.3
1.8.0
1.9.1
1.9.2
1.9.3

Database specific

vanir_signatures

[
    {
        "signature_type": "Function",
        "deprecated": false,
        "source": "https://github.com/flatpak/flatpak/commit/93357d357119093804df05acc32ff335839c6451",
        "signature_version": "v1",
        "id": "CVE-2021-43860-1d540665",
        "digest": {
            "function_hash": "141532740166785984415421914918709778572",
            "length": 3278.0
        },
        "target": {
            "file": "common/flatpak-dir.c",
            "function": "flatpak_dir_pull"
        }
    },
    {
        "signature_type": "Function",
        "deprecated": false,
        "source": "https://github.com/flatpak/flatpak/commit/ba818f504c926baaf6e362be8159cfacf994310e",
        "signature_version": "v1",
        "id": "CVE-2021-43860-3eb1334a",
        "digest": {
            "function_hash": "339737247405246731989476675945704742036",
            "length": 2046.0
        },
        "target": {
            "file": "common/flatpak-dir.c",
            "function": "upgrade_deploy_data"
        }
    },
    {
        "signature_type": "Function",
        "deprecated": false,
        "source": "https://github.com/flatpak/flatpak/commit/93357d357119093804df05acc32ff335839c6451",
        "signature_version": "v1",
        "id": "CVE-2021-43860-4b161cef",
        "digest": {
            "function_hash": "97646939531471039283140005229740933271",
            "length": 9527.0
        },
        "target": {
            "file": "common/flatpak-dir.c",
            "function": "flatpak_dir_deploy"
        }
    },
    {
        "signature_type": "Function",
        "deprecated": false,
        "source": "https://github.com/flatpak/flatpak/commit/ba818f504c926baaf6e362be8159cfacf994310e",
        "signature_version": "v1",
        "id": "CVE-2021-43860-5594e418",
        "digest": {
            "function_hash": "108157274676217845558974616427300781636",
            "length": 3261.0
        },
        "target": {
            "file": "common/flatpak-dir.c",
            "function": "flatpak_dir_pull"
        }
    },
    {
        "signature_type": "Function",
        "deprecated": false,
        "source": "https://github.com/flatpak/flatpak/commit/ba818f504c926baaf6e362be8159cfacf994310e",
        "signature_version": "v1",
        "id": "CVE-2021-43860-5ca9d5b1",
        "digest": {
            "function_hash": "201869370587402139055417088224536499509",
            "length": 588.0
        },
        "target": {
            "file": "common/flatpak-dir.c",
            "function": "validate_commit_metadata"
        }
    },
    {
        "signature_type": "Line",
        "deprecated": false,
        "source": "https://github.com/flatpak/flatpak/commit/ba818f504c926baaf6e362be8159cfacf994310e",
        "signature_version": "v1",
        "id": "CVE-2021-43860-7367118b",
        "digest": {
            "line_hashes": [
                "124588171243196159017325245423169724344",
                "297426710713466060605088962606546847769",
                "165934389046901228074990493218186080362",
                "114060730018427728106657663031172015011",
                "23142527110121917314341611571392501718",
                "62518153213670252093757051117906746599",
                "49410270569780855872032560277951466771",
                "298771084599194939213039736243316336751",
                "68015049258757301742784802346844661454",
                "69272348257012032869529327589425445737",
                "142365861560506242528150096585612340899",
                "126370255795860806015291009246548187126",
                "251641431207220062934404017557492285965",
                "42223758317497889650179176523099628456"
            ],
            "threshold": 0.9
        },
        "target": {
            "file": "common/flatpak-utils.c"
        }
    },
    {
        "signature_type": "Function",
        "deprecated": false,
        "source": "https://github.com/flatpak/flatpak/commit/ba818f504c926baaf6e362be8159cfacf994310e",
        "signature_version": "v1",
        "id": "CVE-2021-43860-77ff53a6",
        "digest": {
            "function_hash": "233027807320338073607589774600227767042",
            "length": 1323.0
        },
        "target": {
            "file": "common/flatpak-transaction.c",
            "function": "try_resolve_op_from_metadata"
        }
    },
    {
        "signature_type": "Function",
        "deprecated": false,
        "source": "https://github.com/flatpak/flatpak/commit/93357d357119093804df05acc32ff335839c6451",
        "signature_version": "v1",
        "id": "CVE-2021-43860-8b7c9d53",
        "digest": {
            "function_hash": "44369606853014012242343163063680559346",
            "length": 780.0
        },
        "target": {
            "file": "common/flatpak-dir.c",
            "function": "validate_commit_metadata"
        }
    },
    {
        "signature_type": "Line",
        "deprecated": false,
        "source": "https://github.com/flatpak/flatpak/commit/93357d357119093804df05acc32ff335839c6451",
        "signature_version": "v1",
        "id": "CVE-2021-43860-8cf9a025",
        "digest": {
            "line_hashes": [
                "57149265493872430027822444391435039971",
                "93888921757088450450621244933121595204",
                "58726908379109311810036282317833112295",
                "241641131146341495441644568526422954398",
                "215675362035243718653504875454687334952",
                "335637409516687678781425605643119607974",
                "235157349365159024898673017082412220955",
                "325785708849771424137837445523432580434",
                "323387029713864623379491020388098677670",
                "16956737829638233055283797266862262703",
                "109958476652233262003307174484882149235",
                "73115411855031086833946676868175620507",
                "68930752288344462197228387810069743745",
                "80495402352877524917172159362624647054",
                "72115217928619700308396391558443496221",
                "14259380173406930917883488799718391961",
                "153217848888722292680949200234219417426",
                "303800768084033029244019993952351342097",
                "58030509145122759570660871855385689047",
                "212286888989208057246131969045308534041",
                "251968170921419775447707999903369839087",
                "72292594319842857139545075225690984659",
                "160620965585170378079297128850168849635",
                "113007455854131867626366658661907703023"
            ],
            "threshold": 0.9
        },
        "target": {
            "file": "common/flatpak-dir.c"
        }
    },
    {
        "signature_type": "Function",
        "deprecated": false,
        "source": "https://github.com/flatpak/flatpak/commit/ba818f504c926baaf6e362be8159cfacf994310e",
        "signature_version": "v1",
        "id": "CVE-2021-43860-a16dbd17",
        "digest": {
            "function_hash": "130268887356355324802151301214002533830",
            "length": 2410.0
        },
        "target": {
            "file": "common/flatpak-utils.c",
            "function": "flatpak_pull_from_bundle"
        }
    },
    {
        "signature_type": "Function",
        "deprecated": false,
        "source": "https://github.com/flatpak/flatpak/commit/ba818f504c926baaf6e362be8159cfacf994310e",
        "signature_version": "v1",
        "id": "CVE-2021-43860-b3e431be",
        "digest": {
            "function_hash": "35507444413538165187572202229198735844",
            "length": 1017.0
        },
        "target": {
            "file": "common/flatpak-transaction.c",
            "function": "resolve_op_from_commit"
        }
    },
    {
        "signature_type": "Line",
        "deprecated": false,
        "source": "https://github.com/flatpak/flatpak/commit/ba818f504c926baaf6e362be8159cfacf994310e",
        "signature_version": "v1",
        "id": "CVE-2021-43860-bc88dfd3",
        "digest": {
            "line_hashes": [
                "100737419827060205170198414800389184387",
                "147773516081525001554295588253374388184",
                "226225098825430752395285439407341201299",
                "303147884397468597738662709471431570791",
                "241641131146341495441644568526422954398",
                "88043545392854206544277765936902990586",
                "59500614890680722908205740340948755221",
                "168256884569841067884185050026736665062",
                "259357256558738351504726465500188503747",
                "181138335075233938374465241475198759983",
                "127017229258498961023957720820318952800",
                "28042782009037569120671434122320668804",
                "231012024652166073477797178561391339267",
                "6489037587716790811367711182929614153",
                "313828336662594673455220358967849379802",
                "145946474572252029719996614458748132423",
                "105378569069162234850768369549942688277",
                "183321967984024006210163039148144222295",
                "316107473565103082443988270586501569191",
                "98223543383625866905502946294220025283",
                "78003675036132145024940266323136981023",
                "159828783754817344216548204969522165493",
                "83960354187234932446953270250865777970",
                "105443273874021836890860840303759115755",
                "181224744156650566400872879786794734155",
                "81887701916145403750761171648458072429",
                "70032870353621431751052726394536128812",
                "28494434730770681077016801247642358209",
                "243157794437306587665422466713735513865",
                "252828546703910787814860840973790694651",
                "314445975014033486486876501564521805295",
                "214481218969469092082669095116137988979",
                "338412271555581422031928028987357398958",
                "226218761533293436320315337539252089534",
                "187733715585570057798640888719938202345",
                "82629542228865644247658191515657695735",
                "59509183817093369878375538042218526829",
                "257878910756238708787772132690214606659",
                "252140756641509854650757499695224544643",
                "100899753757084331058382048621250040764",
                "25506175481870640167739428453839082526",
                "284763049928881514111373346329127519135",
                "179660368344375117315951300530965121794",
                "56925722711802919112719619249771525804",
                "80891711527026972231675690018738210259"
            ],
            "threshold": 0.9
        },
        "target": {
            "file": "common/flatpak-dir.c"
        }
    },
    {
        "signature_type": "Line",
        "deprecated": false,
        "source": "https://github.com/flatpak/flatpak/commit/65cbfac982cb1c83993a9e19aa424daee8e9f042",
        "signature_version": "v1",
        "id": "CVE-2021-43860-c361ed74",
        "digest": {
            "line_hashes": [
                "79544186914356278558251546056413152306",
                "520092593246566280796723113035061984",
                "276621834127765962723261958087198116752"
            ],
            "threshold": 0.9
        },
        "target": {
            "file": "common/flatpak-dir.c"
        }
    },
    {
        "signature_type": "Function",
        "deprecated": false,
        "source": "https://github.com/flatpak/flatpak/commit/ba818f504c926baaf6e362be8159cfacf994310e",
        "signature_version": "v1",
        "id": "CVE-2021-43860-ccdc3492",
        "digest": {
            "function_hash": "5925686855147228042481882271521756390",
            "length": 969.0
        },
        "target": {
            "file": "common/flatpak-transaction.c",
            "function": "load_deployed_metadata"
        }
    },
    {
        "signature_type": "Function",
        "deprecated": false,
        "source": "https://github.com/flatpak/flatpak/commit/65cbfac982cb1c83993a9e19aa424daee8e9f042",
        "signature_version": "v1",
        "id": "CVE-2021-43860-dc8b9dcf",
        "digest": {
            "function_hash": "5850276677081726092477275581287364650",
            "length": 1500.0
        },
        "target": {
            "file": "common/flatpak-dir.c",
            "function": "flatpak_dir_ensure_bundle_remote"
        }
    },
    {
        "signature_type": "Function",
        "deprecated": false,
        "source": "https://github.com/flatpak/flatpak/commit/ba818f504c926baaf6e362be8159cfacf994310e",
        "signature_version": "v1",
        "id": "CVE-2021-43860-e4782c3e",
        "digest": {
            "function_hash": "2696867275489056180011282615357340171",
            "length": 2672.0
        },
        "target": {
            "file": "common/flatpak-transaction.c",
            "function": "flatpak_transaction_add_ref"
        }
    },
    {
        "signature_type": "Line",
        "deprecated": false,
        "source": "https://github.com/flatpak/flatpak/commit/ba818f504c926baaf6e362be8159cfacf994310e",
        "signature_version": "v1",
        "id": "CVE-2021-43860-ef0a0517",
        "digest": {
            "line_hashes": [
                "210648484732517088296769330734129106940",
                "46629451896094101670571230274217458358",
                "162445486178380282586568069834911329075",
                "111740388813201847549500563602858560156",
                "150481912879845550593135711365509310769",
                "256193446523528562998242946403058041632",
                "235817528180193076402361451869924316677",
                "208198275019053322225600353267922397967",
                "248933591574767209822627382570382408461",
                "290473216411275696532154990853373061300",
                "13497216911047613904274732569591815499",
                "182487748692728740097300994311861168371",
                "311053415847645923945277703357330979141",
                "298409011616285831933306185866212696719",
                "124492121589322149192915062175388484543",
                "50843910737737449487675448893836490152"
            ],
            "threshold": 0.9
        },
        "target": {
            "file": "common/flatpak-transaction.c"
        }
    },
    {
        "signature_type": "Function",
        "deprecated": false,
        "source": "https://github.com/flatpak/flatpak/commit/ba818f504c926baaf6e362be8159cfacf994310e",
        "signature_version": "v1",
        "id": "CVE-2021-43860-f076299d",
        "digest": {
            "function_hash": "344809701562139156707791863798175169",
            "length": 9504.0
        },
        "target": {
            "file": "common/flatpak-dir.c",
            "function": "flatpak_dir_deploy"
        }
    }
]