{
    "dataType": "CVE_RECORD",
    "dataVersion": "5.2",
    "cveMetadata": {
        "cveId": "CVE-2024-57947",
        "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "state": "PUBLISHED",
        "assignerShortName": "Linux",
        "dateReserved": "2025-01-19T11:50:08.380Z",
        "datePublished": "2025-01-23T13:54:20.267Z",
        "dateUpdated": "2026-08-05T11:47:01.966Z"
    },
    "containers": {
        "cna": {
            "providerMetadata": {
                "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
                "shortName": "Linux",
                "dateUpdated": "2026-08-05T11:47:01.966Z"
            },
            "descriptions": [
                {
                    "lang": "en",
                    "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nnetfilter: nf_set_pipapo: fix initial map fill\n\nThe initial buffer has to be inited to all-ones, but it must restrict\nit to the size of the first field, not the total field size.\n\nAfter each round in the map search step, the result and the fill map\nare swapped, so if we have a set where f->bsize of the first element\nis smaller than m->bsize_max, those one-bits are leaked into future\nrounds result map.\n\nThis makes pipapo find an incorrect matching results for sets where\nfirst field size is not the largest.\n\nFollowup patch adds a test case to nft_concat_range.sh selftest script.\n\nThanks to Stefano Brivio for pointing out that we need to zero out\nthe remainder explicitly, only correcting memset() argument isn't enough."
                }
            ],
            "metrics": [
                {
                    "cvssV3_1": {
                        "version": "3.1",
                        "vectorString": "CVSS:3.1/AV:N/AC:L/PR:N/UI:N/S:U/C:H/I:H/A:H",
                        "baseScore": 9.8,
                        "baseSeverity": "CRITICAL"
                    },
                    "scenarios": [
                        {
                            "lang": "en",
                            "value": "AV:N - The buggy `nft_pipapo_lookup()` is the per-packet set-matching op invoked from `nft_lookup_eval` on header fields (`ip saddr . tcp dport . meta l4proto`) taken directly from received packets, so a remote off-host attacker's traffic drives the defective classification. The generic C path is what runs on all non-x86_64 firewall/router deployments and on x86_64 via the `!irq_fpu_usable()` fallback.\nAC:L - Once a ruleset uses the common concat-range set layout where the first field expands to fewer rules than a later field, the wrong-match behavior is fully deterministic and repeatable — the attacker simply sends packets and can probe which header values are falsely accepted. No race, no memory-layout dependency, no unknown runtime state.\nPR:N - An unauthenticated, unprivileged remote host needs only to emit packets at the filtering system to reach the miscomputed lookup; no account, credential, or capability on the target is involved. (The control-plane variant via `pipapo_get()` needs only CAP_NET_ADMIN, itself obtainable unprivileged through `unshare -Urn`.)\nUI:N - Classification happens automatically in the packet path for every frame traversing the affected rule; no administrator or victim action is needed for the attacker's traffic to be misclassified.\nS:U - The defect and its consequences are contained in the kernel's netfilter/nf_tables engine within a single security authority, with no crossing of a VM, IOMMU, or sandbox boundary.\nC:H - The flaw defeats the packet filter itself: a source address/port/protocol tuple that policy denies falsely matches an allow-set entry, granting an unauthenticated remote attacker reach to services (management ports, databases, internal listeners) whose data the ruleset was configured to keep unreachable, and `map` sets can steer traffic to an unintended internal destination.\nI:H - The kernel silently enforces a falsified classification result, accepting traffic that must be dropped, and on the control plane `pipapo_get()` makes `nft get/add/delete element` operate on the wrong element, so a delete removes an unrelated entry and the enforced security policy is corrupted without any error being reported.\nA:H - The same systematic false-positive makes permitted traffic match drop/reject entries, persistently blackholing legitimate flows, while insert returning spurious `-EEXIST`/`-ENOTEMPTY` and deletes hitting the wrong element leave the administrator unable to repair the ruleset — a sustained loss of filtering and connectivity for the affected services."
                        }
                    ]
                }
            ],
            "affected": [
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "unaffected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "net/netfilter/nft_set_pipapo.c",
                        "net/netfilter/nft_set_pipapo.h",
                        "net/netfilter/nft_set_pipapo_avx2.c"
                    ],
                    "versions": [
                        {
                            "version": "3c4287f62044a90e73a561aa05fc46e62da173da",
                            "lessThan": "77bf0c4ab928ca4c9a99311f4f70ba0c17fecba9",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "3c4287f62044a90e73a561aa05fc46e62da173da",
                            "lessThan": "957a4d1c4c5849e4515c9fb4db21bf85318103dc",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "3c4287f62044a90e73a561aa05fc46e62da173da",
                            "lessThan": "9625c46ce6fd4f922595a4b32b1de5066d70464f",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "3c4287f62044a90e73a561aa05fc46e62da173da",
                            "lessThan": "69b6a67f7052905e928d75a0c5871de50e686986",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "3c4287f62044a90e73a561aa05fc46e62da173da",
                            "lessThan": "8058c88ac0df21239daee54b5934d5c80ca9685f",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "3c4287f62044a90e73a561aa05fc46e62da173da",
                            "lessThan": "791a615b7ad2258c560f91852be54b0480837c93",
                            "status": "affected",
                            "versionType": "git"
                        }
                    ]
                },
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "affected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "net/netfilter/nft_set_pipapo.c",
                        "net/netfilter/nft_set_pipapo.h",
                        "net/netfilter/nft_set_pipapo_avx2.c"
                    ],
                    "versions": [
                        {
                            "version": "5.6",
                            "status": "affected"
                        },
                        {
                            "version": "0",
                            "lessThan": "5.6",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "5.10.247",
                            "lessThanOrEqual": "5.10.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "5.15.165",
                            "lessThanOrEqual": "5.15.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.1.103",
                            "lessThanOrEqual": "6.1.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.6.44",
                            "lessThanOrEqual": "6.6.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.10.3",
                            "lessThanOrEqual": "6.10.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.11",
                            "lessThanOrEqual": "*",
                            "status": "unaffected",
                            "versionType": "original_commit_for_fix"
                        }
                    ]
                }
            ],
            "cpeApplicability": [
                {
                    "nodes": [
                        {
                            "operator": "OR",
                            "negate": false,
                            "cpeMatch": [
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "5.6",
                                    "versionEndExcluding": "5.10.247"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "5.6",
                                    "versionEndExcluding": "5.15.165"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "5.6",
                                    "versionEndExcluding": "6.1.103"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "5.6",
                                    "versionEndExcluding": "6.6.44"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "5.6",
                                    "versionEndExcluding": "6.10.3"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "5.6",
                                    "versionEndExcluding": "6.11"
                                }
                            ]
                        }
                    ]
                }
            ],
            "references": [
                {
                    "url": "https://git.kernel.org/stable/c/77bf0c4ab928ca4c9a99311f4f70ba0c17fecba9"
                },
                {
                    "url": "https://git.kernel.org/stable/c/957a4d1c4c5849e4515c9fb4db21bf85318103dc"
                },
                {
                    "url": "https://git.kernel.org/stable/c/9625c46ce6fd4f922595a4b32b1de5066d70464f"
                },
                {
                    "url": "https://git.kernel.org/stable/c/69b6a67f7052905e928d75a0c5871de50e686986"
                },
                {
                    "url": "https://git.kernel.org/stable/c/8058c88ac0df21239daee54b5934d5c80ca9685f"
                },
                {
                    "url": "https://git.kernel.org/stable/c/791a615b7ad2258c560f91852be54b0480837c93"
                }
            ],
            "title": "netfilter: nf_set_pipapo: fix initial map fill",
            "x_generator": {
                "engine": "bippy-1.2.0"
            }
        }
    }
}