The GitIdentifiers class in Apache Commons Codec builds serialized Git tree data from application-supplied entry names. Git uses a NUL byte to mark the end of each entry name in a tree object, but affected releases did not reject NUL bytes before serialization. A crafted name could therefore make two different directory trees serialize to the same byte sequence and receive the same Git tree identifier or SWHID.
The precondition is an application that passes externally supplied names into tree construction, such as names read from an archive format that permits NUL bytes, including ZIP, or names supplied directly through an API. Trees built by walking a normal file system are outside the described exposure because common file systems do not allow NUL bytes in file names. The patch centralizes name validation and rejects NUL-containing names, while also adding checks for empty names, ., .., /, unpaired surrogates, and file/directory name conflicts. The downstream use of the identifier and the exact application-level consequences of a collision are not fully established by the available record.