Bug 1120093 (CVE-2014-4978)

Summary: CVE-2014-4978 rawstudio: Insecure use of temporary file
Product: [Other] Security Response Reporter: Vasyl Kaigorodov <vkaigoro>
Component: vulnerabilityAssignee: Red Hat Product Security <security-response-team>
Status: CLOSED ERRATA QA Contact:
Severity: low Docs Contact:
Priority: low    
Version: unspecifiedCC: anders, giallu, jrusnack, sergio
Target Milestone: ---Keywords: Security
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-07-18 05:26:11 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On: 1120094    
Bug Blocks:    

Description Vasyl Kaigorodov 2014-07-16 09:24:05 UTC
The following was reported:
...
The function "rs_filter_graph" located in file ./librawstudio/rs-filter.c contains the following code:

        g_string_append_printf(str, "}\n");
        g_file_set_contents("/tmp/rs-filter-graph", str->str, str->len, NULL);

        ignore = system("dot -Tpng >/tmp/rs-filter-graph.png </tmp/rs-filter-graph");
        ignore = system("gnome-open /tmp/rs-filter-graph.png");

This code makes insecure use of two temporary files:

	/tmp/rs-filter-graph.png
    /tmp/rs-filter-graph

This allows the truncation of arbitrary files which are owned by the user running
rawstudio - for example:

	ln -s ~/.important /tmp/rs-filter-graph
	ln -s /etc/shadow /tmp/rs-filter-graph.png

Comment 1 Vasyl Kaigorodov 2014-07-16 09:24:19 UTC
Created rawstudio tracking bugs for this issue:

Affects: fedora-all [bug 1120094]

Comment 2 Vasyl Kaigorodov 2014-07-16 09:34:22 UTC
CVE request: http://seclists.org/oss-sec/2014/q3/160

Comment 3 Murray McAllister 2014-07-17 04:54:20 UTC
(In reply to Vasyl Kaigorodov from comment #2)
> CVE request: http://seclists.org/oss-sec/2014/q3/160

MITRE assigned CVE-2014-4978 to this issue.

Comment 4 Gianluca Sforna 2014-10-03 06:56:36 UTC
Upstream seems dead, last commit is on February, maybe it's time to retire the package.

Comment 5 Anders Brander 2014-12-03 07:07:26 UTC
This is upstream - not dead :)

Please note that this function can not be called by end users without modifying Rawstudio source. We disabled it in march 2011.

Fix is here for future references:
https://github.com/rawstudio/rawstudio/commit/9c2cd3c93c05d009a91d84eedbb85873b0cb505d

- but IMO the fix is not very important. End users cannot call this without adding a "FilterGraph" menuitem to ui.xml.

Comment 6 Fedora Update System 2015-07-18 02:03:11 UTC
rawstudio-2.1-0.1.20150511git983bda1.fc22 has been pushed to the Fedora 22 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 7 Sergio Basto 2015-07-18 05:26:11 UTC
Closing