{"id":"CVE-2025-68761","state":"PUBLISHED","title":"hfs: fix potential use after free in hfs_correct_next_unused_CNID()","description":"In the Linux kernel, the following vulnerability has been resolved:\n\nhfs: fix potential use after free in hfs_correct_next_unused_CNID()\n\nThis code calls hfs_bnode_put(node) which drops the refcount and then\ndreferences \"node\" on the next line.  It's only safe to use \"node\"\nwhen we're holding a reference so flip these two lines around.","publishedAt":"2026-01-05T09:32:33.814Z","updatedAt":"2026-08-05T12:11:21.089Z","severity":{"score":7.8,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"a06ec283e125e334155fe13005c76c9f484ce759","status":"affected","lessThan":"40a1e0142096dd7dd6cb5373841222b528698588","versionType":"git"},{"version":"a06ec283e125e334155fe13005c76c9f484ce759","status":"affected","lessThan":"c105e76bb17cf4b55fe89c6ad4f6a0e3972b5b08","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/hfs/catalog.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.18","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.18","versionType":"semver"},{"version":"6.18.2","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"6.19","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/hfs/catalog.c"]}],"references":["https://git.kernel.org/stable/c/40a1e0142096dd7dd6cb5373841222b528698588","https://git.kernel.org/stable/c/c105e76bb17cf4b55fe89c6ad4f6a0e3972b5b08"],"weaknesses":[],"ingestedAt":"2026-10-29T20:09:56.034Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2025/68xxx/CVE-2025-68761.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-68761","state":"PUBLISHED","datePublished":"2026-01-05T09:32:33.814Z","dateUpdated":"2026-08-05T12:11:21.089Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-12-24T10:30:51.034Z"},"containers":{"cna":{"title":"hfs: fix potential use after free in hfs_correct_next_unused_CNID()","descriptions":[{"lang":"en","value":"In the Linux kernel, the following vulnerability has been resolved:\n\nhfs: fix potential use after free in hfs_correct_next_unused_CNID()\n\nThis code calls hfs_bnode_put(node) which drops the refcount and then\ndreferences \"node\" on the next line.  It's only safe to use \"node\"\nwhen we're holding a reference so flip these two lines around."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"a06ec283e125e334155fe13005c76c9f484ce759","status":"affected","lessThan":"40a1e0142096dd7dd6cb5373841222b528698588","versionType":"git"},{"version":"a06ec283e125e334155fe13005c76c9f484ce759","status":"affected","lessThan":"c105e76bb17cf4b55fe89c6ad4f6a0e3972b5b08","versionType":"git"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/hfs/catalog.c"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.18","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.18","versionType":"semver"},{"version":"6.18.2","status":"unaffected","lessThanOrEqual":"6.18.*","versionType":"semver"},{"version":"6.19","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","programFiles":["fs/hfs/catalog.c"]}],"references":[{"url":"https://git.kernel.org/stable/c/40a1e0142096dd7dd6cb5373841222b528698588"},{"url":"https://git.kernel.org/stable/c/c105e76bb17cf4b55fe89c6ad4f6a0e3972b5b08"}],"metrics":[{"cvssV3_1":{"version":"3.1","vectorString":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H","baseScore":7.8,"baseSeverity":"HIGH"},"scenarios":[{"lang":"en","value":"AV:L - The vulnerable path is reached locally through unlink, rmdir, or an overwriting rename on a writable, already-mounted HFS filesystem.\nAC:L - An attacker can create thread-only catalog tail nodes, repeatedly delete the highest-CNID object, induce reclaim pressure, and heap-spray the freed node; no condition fundamentally outside attacker control is required.\nPR:L - Mounting HFS requires CAP_SYS_ADMIN in the initial user namespace, but an ordinary user with write and search permission on an existing HFS directory can trigger the vulnerable deletion path.\nUI:N - The attacker directly invokes the filesystem operations, requiring no action by another user once a writable HFS volume is available.\nS:U - Exploitation compromises the host kernel within the same security authority and does not inherently cross a virtualization or comparable isolation boundary.\nC:H - Reclaim and heap spraying can replace the freed B-tree node, after which attacker-controlled tree and page fields may be dereferenced, supporting kernel-memory disclosure.\nI:H - The use-after-free can progress beyond the initial stale prev read into reuse of attacker-sprayed pointer, refcount, and lock fields, supporting arbitrary memory modification or control-flow hijacking.\nA:H - Dereferencing a reclaimed node can cause a kernel oops or panic, while a manipulated traversal can also loop or corrupt critical HFS state."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T12:11:21.089Z"},"cpeApplicability":[{"nodes":[{"operator":"OR","negate":false,"cpeMatch":[{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.18","versionEndExcluding":"6.18.2"},{"vulnerable":true,"criteria":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","versionStartIncluding":"6.18","versionEndExcluding":"6.19"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}