{"id":"CVE-2026-143263","state":"PUBLISHED","title":"netfilter: nat: zero newrange before filling it in","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nnetfilter: nat: zero newrange before filling it in\n\nnf_nat_masquerade_ipv4(), nf_nat_masquerade_ipv6(), netmap_tg4() and\nnetmap_tg6() each build a stack-local struct nf_nat_range2 from the\ncaller-supplied range, inheriting range->flags unmodified. Two of them\nonly memset() the min_addr/max_addr members, the other two don't\nmemset() anything at all, so newrange.base_proto is left as stack\ngarbage.\n\nIf the inherited flags include NF_NAT_RANGE_PROTO_OFFSET,\nnf_nat_l4proto_unique_tuple() reads range->base_proto.all to compute\nthe NAT port offset. Neither the NETMAP nor the MASQUERADE targets\nmask the flags field in their checkentry callback, so this\nuninitialized stack value can end up feeding the NAT port selection.\n\nThe per-member memset()s are not enough: they have to enumerate every\nfield that must be cleared, and base_proto was missed when\nNF_NAT_RANGE_PROTO_OFFSET/base_proto was added to the struct. memset()\nthe whole struct instead, so every member is covered regardless of\nwhich ones get explicitly assigned afterwards.\n\nThere are other places that miss this, but those hardcode .flags so\nnat core won't read from the uninitialized fields.\n\nC99 initializers would be preferrable, but this is a more intrusive\nchange.  Lets followup in nf-next and convert others as well.\n\nThis is an LLM finding.","publishedAt":"2026-12-03T09:21:07.923Z","updatedAt":"2026-12-03T09:21:07.923Z","severity":null,"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"2eb0f624b709e78ec8e2f4c3412947703db99301","status":"affected","lessThan":"36d8d95e7b524eca539b7b5feb8881f71f11b8f1","versionType":"git"},{"version":"2eb0f624b709e78ec8e2f4c3412947703db99301","status":"affected","lessThan":"a2d82bdf0c605f6a59a8f8b7287fae777821eadb","versionType":"git"},{"version":"2eb0f624b709e78ec8e2f4c3412947703db99301","status":"affected","lessThan":"dcc24d3d97c99c9130f62553ef7a8aa32ec32f47","versionType":"git"},{"version":"2eb0f624b709e78ec8e2f4c3412947703db99301","status":"affected","lessThan":"c4488133c577485e0f3a0f3fdf61e944ca42c178","versionType":"git"},{"version":"2eb0f624b709e78ec8e2f4c3412947703db99301","status":"affected","lessThan":"3aee04b4d58cbe6b5e0a9c6d527a936b46f1348a","versionType":"git"},{"version":"2eb0f624b709e78ec8e2f4c3412947703db99301","status":"affected","lessThan":"d1bb235aa409a4e5aeba6c748d953d948625b1e9","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/netfilter/nf_nat_masquerade.c","net/netfilter/xt_NETMAP.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"4.18","status":"affected"},{"version":"0","status":"unaffected","lessThan":"4.18","versionType":"semver"},{"version":"5.10.276","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.227","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.12.120","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.66","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.7","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc3","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/netfilter/nf_nat_masquerade.c","net/netfilter/xt_NETMAP.c"]}],"references":["https://git.kernel.org/stable/c/36d8d95e7b524eca539b7b5feb8881f71f11b8f1","https://git.kernel.org/stable/c/a2d82bdf0c605f6a59a8f8b7287fae777821eadb","https://git.kernel.org/stable/c/dcc24d3d97c99c9130f62553ef7a8aa32ec32f47","https://git.kernel.org/stable/c/c4488133c577485e0f3a0f3fdf61e944ca42c178","https://git.kernel.org/stable/c/3aee04b4d58cbe6b5e0a9c6d527a936b46f1348a","https://git.kernel.org/stable/c/d1bb235aa409a4e5aeba6c748d953d948625b1e9"],"weaknesses":[],"ingestedAt":"2026-12-03T09:42:04.348Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2026/143xxx/CVE-2026-143263.json","commit":"9e309c7c0f08856e2558a1df33f75dca027fab70","baselineCommit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2026-143263","state":"PUBLISHED","datePublished":"2026-12-03T09:21:07.923Z","dateUpdated":"2026-12-03T09:21:07.923Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2026-12-03T03:10:28.363Z"},"containers":{"cna":{"title":"netfilter: nat: zero newrange before filling it in","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nnetfilter: nat: zero newrange before filling it in\n\nnf_nat_masquerade_ipv4(), nf_nat_masquerade_ipv6(), netmap_tg4() and\nnetmap_tg6() each build a stack-local struct nf_nat_range2 from the\ncaller-supplied range, inheriting range->flags unmodified. Two of them\nonly memset() the min_addr/max_addr members, the other two don't\nmemset() anything at all, so newrange.base_proto is left as stack\ngarbage.\n\nIf the inherited flags include NF_NAT_RANGE_PROTO_OFFSET,\nnf_nat_l4proto_unique_tuple() reads range->base_proto.all to compute\nthe NAT port offset. Neither the NETMAP nor the MASQUERADE targets\nmask the flags field in their checkentry callback, so this\nuninitialized stack value can end up feeding the NAT port selection.\n\nThe per-member memset()s are not enough: they have to enumerate every\nfield that must be cleared, and base_proto was missed when\nNF_NAT_RANGE_PROTO_OFFSET/base_proto was added to the struct. memset()\nthe whole struct instead, so every member is covered regardless of\nwhich ones get explicitly assigned afterwards.\n\nThere are other places that miss this, but those hardcode .flags so\nnat core won't read from the uninitialized fields.\n\nC99 initializers would be preferrable, but this is a more intrusive\nchange.  Lets followup in nf-next and convert others as well.\n\nThis is an LLM finding."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"2eb0f624b709e78ec8e2f4c3412947703db99301","status":"affected","lessThan":"36d8d95e7b524eca539b7b5feb8881f71f11b8f1","versionType":"git"},{"version":"2eb0f624b709e78ec8e2f4c3412947703db99301","status":"affected","lessThan":"a2d82bdf0c605f6a59a8f8b7287fae777821eadb","versionType":"git"},{"version":"2eb0f624b709e78ec8e2f4c3412947703db99301","status":"affected","lessThan":"dcc24d3d97c99c9130f62553ef7a8aa32ec32f47","versionType":"git"},{"version":"2eb0f624b709e78ec8e2f4c3412947703db99301","status":"affected","lessThan":"c4488133c577485e0f3a0f3fdf61e944ca42c178","versionType":"git"},{"version":"2eb0f624b709e78ec8e2f4c3412947703db99301","status":"affected","lessThan":"3aee04b4d58cbe6b5e0a9c6d527a936b46f1348a","versionType":"git"},{"version":"2eb0f624b709e78ec8e2f4c3412947703db99301","status":"affected","lessThan":"d1bb235aa409a4e5aeba6c748d953d948625b1e9","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/netfilter/nf_nat_masquerade.c","net/netfilter/xt_NETMAP.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"4.18","status":"affected"},{"version":"0","status":"unaffected","lessThan":"4.18","versionType":"semver"},{"version":"5.10.276","status":"unaffected","lessThanOrEqual":"5.10.*","versionType":"semver"},{"version":"5.15.227","status":"unaffected","lessThanOrEqual":"5.15.*","versionType":"semver"},{"version":"6.12.120","status":"unaffected","lessThanOrEqual":"6.12.*","versionType":"semver"},{"version":"6.18.66","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"7.3.7","status":"unaffected","lessThanOrEqual":"7.3.*","versionType":"semver"},{"version":"7.4-rc3","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["net/netfilter/nf_nat_masquerade.c","net/netfilter/xt_NETMAP.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/36d8d95e7b524eca539b7b5feb8881f71f11b8f1"},{"url":"https://git.kernel.org/stable/c/a2d82bdf0c605f6a59a8f8b7287fae777821eadb"},{"url":"https://git.kernel.org/stable/c/dcc24d3d97c99c9130f62553ef7a8aa32ec32f47"},{"url":"https://git.kernel.org/stable/c/c4488133c577485e0f3a0f3fdf61e944ca42c178"},{"url":"https://git.kernel.org/stable/c/3aee04b4d58cbe6b5e0a9c6d527a936b46f1348a"},{"url":"https://git.kernel.org/stable/c/d1bb235aa409a4e5aeba6c748d953d948625b1e9"}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-12-03T09:21:07.923Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.18","versionEndExcluding":"5.10.276"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.18","versionEndExcluding":"5.15.227"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.18","versionEndExcluding":"6.12.120"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.18","versionEndExcluding":"6.18.66"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.18","versionEndExcluding":"7.3.7"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"4.18","versionEndExcluding":"7.4-rc3"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}