The GitIdentifiers class in Apache Commons Codec did not reject NUL bytes in tree entry names. Because Git uses a NUL byte to mark the end of each entry name in a tree object, a crafted name could make one tree serialize to the same bytes as a different tree. Two different directory trees could then receive the same Git tree identifier or SWHID.
The impact is limited: common file systems do not allow NUL bytes in file names, so trees built by walking a file system are not affected. Only applications that build trees from names supplied by other sources, such as entries of archive formats that permit NUL bytes in names (e.g. ZIP) or names passed directly to the API, are exposed.
This issue affects Apache Commons Codec: from 1.22.0 before 1.23.0.
Users are recommended to upgrade to version 1.23.0, which fixes the issue.
{
"cna_assigner": "apache",
"cwe_ids": [
"CWE-158"
],
"osv_generated_from": "https://github.com/CVEProject/cvelistV5/tree/main/cves/2026/124xxx/CVE-2026-124077.json"
}{
"extracted_events": [
{
"range": [
{
"introduced": "387120c901f4a75c3112dfdf8877dcdec7ae685d"
},
{
"fixed": "87f6aa2818836998528ff4b0d1ea35545a800ee5"
}
],
"source": "AFFECTED_FIELD",
"strategy": "StandardRange"
}
]
}
{
"extracted_events": [
{
"range": [
{
"introduced": "1.22.0"
},
{
"fixed": "1.23.0"
}
],
"source": "AFFECTED_FIELD",
"strategy": "StandardRange"
},
{
"range": [
{
"fixed": "87f6aa2818836998528ff4b0d1ea35545a800ee5"
}
],
"source": "REFERENCES_COMMIT"
}
]
}
"https://storage.googleapis.com/cve-osv-conversion/osv-output/CVE-2026-124077.json"
[
{
"deprecated": false,
"digest": {
"function_hash": "166229544964305466856509455083161865214",
"length": 468
},
"id": "CVE-2026-124077-1b4d1bf5",
"signature_type": "Function",
"signature_version": "v1",
"source": "https://gitbox.apache.org/repos/asf/commons-codec.git@87f6aa2818836998528ff4b0d1ea35545a800ee5",
"target": {
"file": "src/main/java/org/apache/commons/codec/digest/GitIdentifiers.java",
"function": "DirectoryEntry"
}
},
{
"deprecated": false,
"digest": {
"line_hashes": [
"138151963254234810538070329741136355331",
"129085705613964892071095601812887426666",
"152216034822351672492152330648384497438",
"7194913908906554424417288256246228400",
"187268808403066209911508262867622385568",
"162610214247926913308645762269254546369",
"212371664303964174636674657524185597547",
"242451601440504936803581158760756606757",
"92911012603975688923595171570075645784",
"315292630412147803003106464200073779589",
"130950738141526846957245546859372936013",
"101214622859017396362328698522423226831",
"69588159566050744155467346341028731938",
"336698097428700550419127879680007108243",
"86819765408935952532514753524464304729",
"76156477340271346004401850077212930858",
"226580949188737449415957314796139482962",
"149723245538549779686146124698988722838",
"326669288040467532668735728646122956064",
"83029472309640642812342458476858238879",
"76832444951785136517288943090252197955",
"216987731098821906124052869820833299469",
"301759706108901547521706238916620916489",
"4561662915194660613097496476719149464",
"19603769106725301848172283919762049479",
"278339893333610762518361629318996338619",
"140606884276017201989343856082537784419",
"253811377643707138308644435950220478533",
"96923170693077102059651986117477321772",
"130924288305551319078875139216941484109",
"155630962515114890971654500683374515842",
"263703923265001761699845397241860073611",
"24482684864596138437461579486993770643",
"336557640263933737490496814454287113552",
"100214163922978597796158232005809414459",
"129244915777210425882936758027923233243",
"250445071873912840899424013050654698436",
"203844449525363654066905065439622499690"
],
"threshold": 0.9
},
"id": "CVE-2026-124077-249cc77d",
"signature_type": "Line",
"signature_version": "v1",
"source": "https://github.com/apache/commons-codec/commit/87f6aa2818836998528ff4b0d1ea35545a800ee5",
"target": {
"file": "src/test/java/org/apache/commons/codec/digest/GitIdentifiersTest.java"
}
},
{
"deprecated": false,
"digest": {
"function_hash": "68145301230290198001152756875578083908",
"length": 316
},
"id": "CVE-2026-124077-42426fc5",
"signature_type": "Function",
"signature_version": "v1",
"source": "https://gitbox.apache.org/repos/asf/commons-codec.git@87f6aa2818836998528ff4b0d1ea35545a800ee5",
"target": {
"file": "src/main/java/org/apache/commons/codec/digest/GitIdentifiers.java",
"function": "addDirectory"
}
},
{
"deprecated": false,
"digest": {
"function_hash": "106437427559356437658102852425683462959",
"length": 380
},
"id": "CVE-2026-124077-4a391559",
"signature_type": "Function",
"signature_version": "v1",
"source": "https://github.com/apache/commons-codec/commit/87f6aa2818836998528ff4b0d1ea35545a800ee5",
"target": {
"file": "src/main/java/org/apache/commons/codec/digest/GitIdentifiers.java",
"function": "addFile"
}
},
{
"deprecated": false,
"digest": {
"function_hash": "68145301230290198001152756875578083908",
"length": 316
},
"id": "CVE-2026-124077-5f4cf1f4",
"signature_type": "Function",
"signature_version": "v1",
"source": "https://github.com/apache/commons-codec/commit/87f6aa2818836998528ff4b0d1ea35545a800ee5",
"target": {
"file": "src/main/java/org/apache/commons/codec/digest/GitIdentifiers.java",
"function": "addDirectory"
}
},
{
"deprecated": false,
"digest": {
"function_hash": "239590348155337867717030368775568359655",
"length": 563
},
"id": "CVE-2026-124077-6fed2a22",
"signature_type": "Function",
"signature_version": "v1",
"source": "https://gitbox.apache.org/repos/asf/commons-codec.git@87f6aa2818836998528ff4b0d1ea35545a800ee5",
"target": {
"file": "src/test/java/org/apache/commons/codec/digest/GitIdentifiersTest.java",
"function": "testTreeIdKeepsNamesWithTheSameUtf8Bytes"
}
},
{
"deprecated": false,
"digest": {
"line_hashes": [
"47502393709873344522968196439059696320",
"70667530016934417483340380573962051355",
"245528405852263098898653151314157833650",
"115904795457192258360610581450343421347",
"187914385277955208973884866576266517699",
"130770361759718133574284018323229639833",
"252342660500783836839731336826673961605",
"325764754530823949870185468517766321594",
"89308378866899735609851158952076244668",
"190380935276774078727343607783811185037",
"95914867787442583473324643079046173640",
"136675725999759995514051376798319722574",
"20615662109148860373600150029966081021",
"220730371254810251552088536880722053146",
"118590684884826327544619727786640185159",
"301158065201135048108225304152871872470",
"328459960725678338516469813172367042566",
"182942916615161327367866033421381046874",
"172750456424699610642175032868862752124",
"298931073665572674674985695915948760103",
"182257432504572532219777124435094121847",
"150948931006852022604737727559149665649",
"50673034070653984071783985716077906327",
"170452452599986538613291734966944113721",
"171181621189528720210680439202014340779",
"73595009494654935872129551753023846532",
"44774555319697526536088368435824277473",
"84802107678954889279613972392472894332",
"286217447430524095331266205218112101654",
"121017933019365187007029033507828821110",
"38429732274350277024945595226815196917",
"95296798878289897112410328116283972353",
"57471342300240356072273695956798458922",
"147568871146771342145741654171344982950",
"339895951080435574782698848757468865562",
"139793488664474489345707249488675003046",
"15488402337185474157728538191959922284",
"25874069364587784213004066510923131532",
"305798448092638164563397312370124571369",
"5983178408648719971072024700201217367",
"53537874675243357382484613174636288728",
"255576254495524440903786664766283296310",
"67511496953582074781171928673212718067",
"151212160782487434054320919134505521023",
"337599601463836029682182815595733471746"
],
"threshold": 0.9
},
"id": "CVE-2026-124077-7427d326",
"signature_type": "Line",
"signature_version": "v1",
"source": "https://github.com/apache/commons-codec/commit/87f6aa2818836998528ff4b0d1ea35545a800ee5",
"target": {
"file": "src/main/java/org/apache/commons/codec/digest/GitIdentifiers.java"
}
},
{
"deprecated": false,
"digest": {
"function_hash": "198104722673381710926969588422925788995",
"length": 156
},
"id": "CVE-2026-124077-79bec5bc",
"signature_type": "Function",
"signature_version": "v1",
"source": "https://gitbox.apache.org/repos/asf/commons-codec.git@87f6aa2818836998528ff4b0d1ea35545a800ee5",
"target": {
"file": "src/main/java/org/apache/commons/codec/digest/GitIdentifiers.java",
"function": "requireNoParentTraversal"
}
},
{
"deprecated": false,
"digest": {
"function_hash": "216474605459880968061730329750279964830",
"length": 801
},
"id": "CVE-2026-124077-7cc43dc2",
"signature_type": "Function",
"signature_version": "v1",
"source": "https://gitbox.apache.org/repos/asf/commons-codec.git@87f6aa2818836998528ff4b0d1ea35545a800ee5",
"target": {
"file": "src/main/java/org/apache/commons/codec/digest/GitIdentifiers.java",
"function": "get"
}
},
{
"deprecated": false,
"digest": {
"line_hashes": [
"138151963254234810538070329741136355331",
"129085705613964892071095601812887426666",
"152216034822351672492152330648384497438",
"7194913908906554424417288256246228400",
"187268808403066209911508262867622385568",
"162610214247926913308645762269254546369",
"212371664303964174636674657524185597547",
"242451601440504936803581158760756606757",
"92911012603975688923595171570075645784",
"315292630412147803003106464200073779589",
"130950738141526846957245546859372936013",
"101214622859017396362328698522423226831",
"69588159566050744155467346341028731938",
"336698097428700550419127879680007108243",
"86819765408935952532514753524464304729",
"76156477340271346004401850077212930858",
"226580949188737449415957314796139482962",
"149723245538549779686146124698988722838",
"326669288040467532668735728646122956064",
"83029472309640642812342458476858238879",
"76832444951785136517288943090252197955",
"216987731098821906124052869820833299469",
"301759706108901547521706238916620916489",
"4561662915194660613097496476719149464",
"19603769106725301848172283919762049479",
"278339893333610762518361629318996338619",
"140606884276017201989343856082537784419",
"253811377643707138308644435950220478533",
"96923170693077102059651986117477321772",
"130924288305551319078875139216941484109",
"155630962515114890971654500683374515842",
"263703923265001761699845397241860073611",
"24482684864596138437461579486993770643",
"336557640263933737490496814454287113552",
"100214163922978597796158232005809414459",
"129244915777210425882936758027923233243",
"250445071873912840899424013050654698436",
"203844449525363654066905065439622499690"
],
"threshold": 0.9
},
"id": "CVE-2026-124077-888e7a3a",
"signature_type": "Line",
"signature_version": "v1",
"source": "https://gitbox.apache.org/repos/asf/commons-codec.git@87f6aa2818836998528ff4b0d1ea35545a800ee5",
"target": {
"file": "src/test/java/org/apache/commons/codec/digest/GitIdentifiersTest.java"
}
},
{
"deprecated": false,
"digest": {
"function_hash": "166229544964305466856509455083161865214",
"length": 468
},
"id": "CVE-2026-124077-b7f008dc",
"signature_type": "Function",
"signature_version": "v1",
"source": "https://github.com/apache/commons-codec/commit/87f6aa2818836998528ff4b0d1ea35545a800ee5",
"target": {
"file": "src/main/java/org/apache/commons/codec/digest/GitIdentifiers.java",
"function": "DirectoryEntry"
}
},
{
"deprecated": false,
"digest": {
"function_hash": "106437427559356437658102852425683462959",
"length": 380
},
"id": "CVE-2026-124077-b944e62a",
"signature_type": "Function",
"signature_version": "v1",
"source": "https://gitbox.apache.org/repos/asf/commons-codec.git@87f6aa2818836998528ff4b0d1ea35545a800ee5",
"target": {
"file": "src/main/java/org/apache/commons/codec/digest/GitIdentifiers.java",
"function": "addFile"
}
},
{
"deprecated": false,
"digest": {
"function_hash": "198104722673381710926969588422925788995",
"length": 156
},
"id": "CVE-2026-124077-c5f4c9f1",
"signature_type": "Function",
"signature_version": "v1",
"source": "https://github.com/apache/commons-codec/commit/87f6aa2818836998528ff4b0d1ea35545a800ee5",
"target": {
"file": "src/main/java/org/apache/commons/codec/digest/GitIdentifiers.java",
"function": "requireNoParentTraversal"
}
},
{
"deprecated": false,
"digest": {
"function_hash": "216474605459880968061730329750279964830",
"length": 801
},
"id": "CVE-2026-124077-c7c449d5",
"signature_type": "Function",
"signature_version": "v1",
"source": "https://github.com/apache/commons-codec/commit/87f6aa2818836998528ff4b0d1ea35545a800ee5",
"target": {
"file": "src/main/java/org/apache/commons/codec/digest/GitIdentifiers.java",
"function": "get"
}
},
{
"deprecated": false,
"digest": {
"function_hash": "239590348155337867717030368775568359655",
"length": 563
},
"id": "CVE-2026-124077-d5e75249",
"signature_type": "Function",
"signature_version": "v1",
"source": "https://github.com/apache/commons-codec/commit/87f6aa2818836998528ff4b0d1ea35545a800ee5",
"target": {
"file": "src/test/java/org/apache/commons/codec/digest/GitIdentifiersTest.java",
"function": "testTreeIdKeepsNamesWithTheSameUtf8Bytes"
}
},
{
"deprecated": false,
"digest": {
"line_hashes": [
"47502393709873344522968196439059696320",
"70667530016934417483340380573962051355",
"245528405852263098898653151314157833650",
"115904795457192258360610581450343421347",
"187914385277955208973884866576266517699",
"130770361759718133574284018323229639833",
"252342660500783836839731336826673961605",
"325764754530823949870185468517766321594",
"89308378866899735609851158952076244668",
"190380935276774078727343607783811185037",
"95914867787442583473324643079046173640",
"136675725999759995514051376798319722574",
"20615662109148860373600150029966081021",
"220730371254810251552088536880722053146",
"118590684884826327544619727786640185159",
"301158065201135048108225304152871872470",
"328459960725678338516469813172367042566",
"182942916615161327367866033421381046874",
"172750456424699610642175032868862752124",
"298931073665572674674985695915948760103",
"182257432504572532219777124435094121847",
"150948931006852022604737727559149665649",
"50673034070653984071783985716077906327",
"170452452599986538613291734966944113721",
"171181621189528720210680439202014340779",
"73595009494654935872129551753023846532",
"44774555319697526536088368435824277473",
"84802107678954889279613972392472894332",
"286217447430524095331266205218112101654",
"121017933019365187007029033507828821110",
"38429732274350277024945595226815196917",
"95296798878289897112410328116283972353",
"57471342300240356072273695956798458922",
"147568871146771342145741654171344982950",
"339895951080435574782698848757468865562",
"139793488664474489345707249488675003046",
"15488402337185474157728538191959922284",
"25874069364587784213004066510923131532",
"305798448092638164563397312370124571369",
"5983178408648719971072024700201217367",
"53537874675243357382484613174636288728",
"255576254495524440903786664766283296310",
"67511496953582074781171928673212718067",
"151212160782487434054320919134505521023",
"337599601463836029682182815595733471746"
],
"threshold": 0.9
},
"id": "CVE-2026-124077-fecbf3f8",
"signature_type": "Line",
"signature_version": "v1",
"source": "https://gitbox.apache.org/repos/asf/commons-codec.git@87f6aa2818836998528ff4b0d1ea35545a800ee5",
"target": {
"file": "src/main/java/org/apache/commons/codec/digest/GitIdentifiers.java"
}
}
]
"2026-11-14T07:14:39Z"