-
CVSS Score
-| Package Name | Ecosystem | Vulnerable Versions | First Patched Version |
|---|---|---|---|
| github.com/bep/imagemeta | go | < 0.10.0 | 0.10.0 |
The vulnerability lies in the lack of limits on the number and size of EXIF/IPTC tags and records that the library would attempt to process. The provided commit patch (4fd89616d8bf7f9bb892360d3fb19080ec2b4602) introduces mitigations by adding LimitNumTags and LimitTagSize options and enforcing these limits in specific functions.
Decode function in imagemeta.go is the main entry point for parsing. It was modified to enforce LimitNumTags by wrapping the ShouldHandleTag callback. Before this, it would process all tags passed by ShouldHandleTag.metaDecoderEXIF.decodeTag function in metadecoder_exif.go is responsible for decoding EXIF tags. It was modified to check the tag's value length against LimitTagSize. Before this, it would attempt to process tags of any size.metaDecoderIPTC.decodeRecord function in metadecoder_iptc.go is responsible for decoding IPTC records. It was modified to check the record size against LimitTagSize. Before this, it would attempt to process records of any size.
These three functions are directly involved in processing the potentially malicious input (image metadata) and were modified to add the necessary size and count checks, indicating they were the points where the vulnerability could be triggered.