Insecure temporary file use in OCAL code

Bug #191847 reported by Lubomir Rintel
254
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Medium
Kees Cook
inkscape (Fedora)
Fix Released
Low

Bug Description

Here are the patches:

This one is ugly. Pardon me, I never wrote C++ code longer than three lines before.
If someone uses "Mentor someone fixing this bug" I'd be very happy.
http://cvs.fedora.redhat.com/viewcvs/*checkout*/rpms/inkscape/devel/inkscape-0.46pre1-ocal1.patch

This one is not as ugly as first. Also contains workaround for bug #179326
http://cvs.fedora.redhat.com/viewcvs/*checkout*/rpms/inkscape/devel/inkscape-0.46pre1-ocal2.patch

Revision history for this message
In , Lubomir (lubomir-redhat-bugs) wrote :

Description of problem:

Inkscape uses predictable names for OCAL feed's and thumbnails' temporary files,
which make it possible for a local attacker to overwrite files via symlink attack.

Revision history for this message
In , Lubomir (lubomir-redhat-bugs) wrote :

Fixed in inkscape-0.45.1+0.46pre1-4

Revision history for this message
In , Lubomir (lubomir-redhat-bugs) wrote :
Revision history for this message
In , Lubomir (lubomir-redhat-bugs) wrote :

CVE name was requested.

Revision history for this message
Lubomir Rintel (lkundrak) wrote :

Note -ocal1.patch also fixes a functionality bug. If two cliparts possibly in different directories had same file name, only thumbnail of the first one would be visible.

Ted Gould (ted)
Changed in inkscape:
milestone: none → 0.46
Revision history for this message
Lubomir Rintel (lkundrak) wrote :

Actually -ocal1.patch is broken. Choosing a random file name such as /tmp/mHpvUM looses the file extenstion and in case it's not SVG inkscape won't be able to open it as it won't be able to determine the file type. Possible solution would be to use a temporary directory so that it will be possible for file names to be chosen arbitrarily instead of randomly.

Changed in inkscape:
status: Unknown → Confirmed
Revision history for this message
Kees Cook (kees) wrote :

I've applied ocal2.patch to SVN now. Thanks for these fixes!

I'm investigating other solutions for the ocal1.patch issues.

Changed in inkscape:
assignee: nobody → keescook
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
Kees Cook (kees) wrote :

Based on Lubomir's patch, I've fixed up the temp file handling. While it might be possible to DoS-race the target, it is no longer vulnerable to overwrite attacks.

Changed in inkscape:
status: Confirmed → Fix Released
Changed in inkscape:
status: Confirmed → Fix Released
Changed in inkscape (Fedora):
importance: Unknown → Low
To post a comment you must log in.
This report contains Public Security information  
Everyone can see this security related information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.