The vulnerability lies in go-git's lenient parsing of commit and tag objects, which could lead to an interpretation of the object that is inconsistent with upstream Git. This discrepancy could be exploited to bypass signature verification. An attacker could craft a commit or tag with malformed headers that go-git would parse into a seemingly valid object, while upstream Git would either reject it or interpret it differently. When this object is signed, the signature is created for the malformed object. However, when go-git verifies the signature, it re-encodes the object from its parsed (and incorrect) representation, leading to a byte-for-byte mismatch with the original object and a failed verification. The patch addresses this by implementing a stricter, state machine-based parser for both commit and tag objects that mirrors the behavior of upstream Git. It also ensures that signature verification is performed on the raw, unmodified object bytes, rather than a re-encoded version. Finally, it adds a check to reject commits with multiple signatures, further aligning with upstream Git's behavior and reducing ambiguity.