-
Notifications
You must be signed in to change notification settings - Fork 229
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RCE vulnerability in libwebp dependency #1903
Comments
A few months ago I compiled it again (tesseract version 5.3.0) to check if there was any improvement comparing to the version we are using (5.0.0), but it wasn't the case. |
Great, thank you! |
Just built Tesseract 5.3.2-24-g3922 (latest version), but it uses libwebp-1.3.1. |
There is no urgent need @tc-wleite! I just got an answer from ImageMagick project:
So we could redirect webp to imagemagick before tesseract, as we do for other non standard formats. |
I finally managed to build tesseract 5.3.2 with libwebp-1.3.2. Tests with a few samples are looking good. |
Thank you very much @tc-wleite! But as I said, don't hurry, we can use imagemagick as a workaround. |
Tesseract 5.3.2. compiled for Windows with libwebp 1.3.2: tesseract.zip
I processed a large set of images and PDFs (around 20K files in total), with the new version and the one we currently use (5.0.0). |
Awesome! Thank you @tc-wleite! I'll update tesseract and imagemagick, cherry pick other important fixes (like #1879) and try to release 4.1.5 early in the next week. |
Just started an ImageMagick regression test on 300K samples of non standard image formats collected from 220 different cases. Probably I'll post the results tomorrow. |
Hi @tc-wleite, I'm thinking to use ImageMagick dynamically instead of statically linked (maybe it runs faster), what do you think? |
I started a performance test. Unless there is an important difference, I'll keep the statically linked version, since all official IM portable versions are statically linked. |
I usually prefer static linked libraries. My intuition is that performance should be very similar in the case of ImageMagick, but it is better to test! By the way, if you want to compare generated thumbnails from the test you made, between the newer IM version and the one currently used, not sure if you remember, but I wrote a small program that point out the hashes of the N images with "more different" thumbnails. So you can filter in both cases (if you still have the cases) and visually compare just a small subset, not thousands of images. |
Yes I remember, that would be great! What's the input, the IPED cases or the thumbs databases? |
Thumbs database. |
It needs SQLite JDBC jar. EDIT: Code was too long, it is better to attach it: CompareThumbs.zip |
Thank you @tc-wleite! Just did the comparison, differences are very minor, just one JP2 was rendered with different colors/brightness, but I think it is fine. And looking into the EMF number difference, it is due to timeouts, old ImageMagick is also able to render them in ImageViewer. So I think we are fine and I will proceed with both upgrades. |
@tc-wleite, just realized mplayer may link to libwebp too... Do you know if it does? At least, we don't process webp using mplayer, just animated heic, heif, gif & png, right? |
I believe that FFmpeg (used by MPlayer) uses libwebp, but only to encode, not to decode. From time to time, I check new MPlayer versions for Windows. |
Thank you @tc-wleite for your research! Since the issue is triggered by decoding a malicious webp and FFmpeg/Mplayer doesn't support it, I think we are safe. |
libwebp is used by tesseract and imagemagick, we should upgrade libwebp to 1.3.2 version as described here:
https://nvd.nist.gov/vuln/detail/CVE-2023-4863
@tc-wleite, as you already compiled tesseract from source, would it be easy to compile it again with libwebp-1.3.2?
About imagemagick, I already reported the dependency issue to them. If they are not fast, we may think about compiling it from source...
For users, to mitigate the problem within IPED for now, it is enough to disable OCR and set
enableExternalConv = false
inconf/ImageThumbsConfig.txt
The text was updated successfully, but these errors were encountered: