| Summary: | ANI plugin DoS vulnerability | ||
|---|---|---|---|
| Product: | [Frameworks and Libraries] frameworks-kimageformats | Reporter: | iphydf |
| Component: | general | Assignee: | Alex Merry <alex.merry> |
| Status: | RESOLVED FIXED | ||
| Severity: | grave | CC: | aacid, kdelibs-bugs-null |
| Priority: | NOR | ||
| Version First Reported In: | 6.9.0 | ||
| Target Milestone: | --- | ||
| Platform: | Compiled Sources | ||
| OS: | All | ||
| Latest Commit: | https://invent.kde.org/frameworks/kimageformats/-/commit/f39ca9dc9bff27a7c087fd4fc58c148c0f66914a | Version Fixed/Implemented In: | |
| Sentry Crash Report: | |||
|
Description
iphydf
2025-01-08 01:30:23 UTC
Please attach a file that causes a problem. https://github.com/TokTok/toktok-stack/blob/31385ffceba1ab2f8672893bbef6c8ef8a32eb07/third_party/kimageformats/test/qimage_test.cpp#L48-L50 Base64-encoded: ``` AFJJRkYOAACAQUNPTgB+YAAAAAAAUklGRg4AAIBBQ09OAH5gAAAAAABzZXEgANra2tra2tra2tra2t ra2tra2tra2tra2tra2tra2tra2traAAAAAAAAAAAAAAAAAF0= ``` Strip the first byte, then it's an input file that causes this. i can not reproduce any wrong memory access with that code neigher with valgrind nor with asan. Do you have a backtrace you can share with us? It's not a wrong memory access, it's a 4GB memory allocation. Try setting ulimit to something not unlimited. A possibly relevant merge request was started @ https://invent.kde.org/frameworks/kimageformats/-/merge_requests/310 Git commit f39ca9dc9bff27a7c087fd4fc58c148c0f66914a by Albert Astals Cid. Committed on 13/01/2025 at 23:40. Pushed by mircomir into branch 'master'. ani: Read chunk elements one at a time instead all at once This way if the file is malformed and there's not that many elements we don't try allocate too much memory to read into M +7 -5 src/imageformats/ani.cpp https://invent.kde.org/frameworks/kimageformats/-/commit/f39ca9dc9bff27a7c087fd4fc58c148c0f66914a Thank you so much for the quick fixes. I'll be running a fuzzer against all the plugins for a while. If I find more issues, I'll file more bugs. We want to use these plugins for our chat client (qTox) and want to be sure people can't abuse it easily. |