Bug 528000 - Tainted variables in sprintf format
Summary: Tainted variables in sprintf format
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Fedora
Classification: Fedora
Component: perl-Image-ExifTool
Version: 10
Hardware: All
OS: Linux
low
medium
Target Milestone: ---
Assignee: Tom "spot" Callaway
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-10-08 15:05 UTC by Patrick Monnerat
Modified: 2009-12-18 09:44 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2009-12-18 09:44:35 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Patrick Monnerat 2009-10-08 15:05:04 UTC
Description of problem:
Some tainted variable(s) are used in sprintf statement(s) causing warnings when calling program is executed with the -T option. In example:

Insecure dependency in sprintf while running with -T switch at /usr/lib/perl5/vendor_perl/5.10.0/Image/ExifTool/Exif.pm line 2958 

Version-Release number of selected component (if applicable):
perl-5.10.0-73.fc10.i386
perl-Image-Exiftool-7.67-1.fc10.noarch

How reproducible:
Always in 5.10.0, providing the sprintf statement is reached.

Steps to Reproduce:
I don't know how to force it: I discovered it while testing a spamassassin OCR plugin.
  
Actual results:
See above

Expected results:
No warning

Comment 1 Tom "spot" Callaway 2009-10-08 15:54:30 UTC
Hrm. This will be tough to fix/report upstream without a way to reproduce it.

Comment 2 Marcela Mašláňová 2009-10-08 16:04:05 UTC
There was problem with spamassasin which was workaround with rebuild of perl. But I made the change only in F-12 build. Could be the same issue? #510127

Comment 3 Patrick Monnerat 2009-10-08 17:38:42 UTC
Here are some details. The lines causing the trouble are:

$format and $exifTool->Warn(
       sprintf("Unknown format ($format) for $dirName tag 0x%x",$tagID));

So $format and/or $dirName are tainted. I'm not a Perl guy, so I can hardly backtrack these variable's sources (it even comes from out of the module), but I think the faulty statement can be rewritten as:

$format and $exifTool->Warn(
       sprintf("Unknown format (%d) for %s tag 0x%x",$format,$dirName,$tagID));

in a more secure way that does not cause the taint problem, but at the expense of poorer readability, I agree.

From what I can see by examining Exif.pm, some other sprintf statements might be subject to similar problems (i.e.: lines 2918, 2941, 2972, ...).

I apologize for not being able to reproduce, but the line is reached when there is an unknown format in an Exif directory of a picture that I do not have anymore (rejected by SpamAssassin!)

Whether the current bug is related to bug 510127 or not is out of my Perl understanding... and since I do not know how to reproduce, I cannot even test it on rawhide :-( Sorry and thanks for the proposal.

Comment 4 Marcela Mašláňová 2009-10-09 12:19:21 UTC
You can try latest rebuild of perl for F-10. It will be in testing updates in few days or download from: http://koji.fedoraproject.org/koji/buildinfo?buildID=135920

Comment 5 Phil Harvey 2009-10-09 17:09:44 UTC
If this generates taint errors, I'm surprised that exiftool doesn't
generate more.  The value of $format is obtained from an unpack('S',...)
call, so the result is guaranteed to be either undefined or a number
in the range 0 to 65535.  How is this a security problem when used
in a sprintf format string?

Comment 6 Bug Zapper 2009-11-18 12:16:56 UTC
This message is a reminder that Fedora 10 is nearing its end of life.
Approximately 30 (thirty) days from now Fedora will stop maintaining
and issuing updates for Fedora 10.  It is Fedora's policy to close all
bug reports from releases that are no longer maintained.  At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '10'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 10's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 10 is end of life.  If you 
would still like to see this bug fixed and are able to reproduce it 
against a later version of Fedora please change the 'version' of this 
bug to the applicable version.  If you are unable to change the version, 
please add a comment here and someone will do it for you.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events.  Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

The process we are following is described here: 
http://fedoraproject.org/wiki/BugZappers/HouseKeeping

Comment 7 Bug Zapper 2009-12-18 09:44:35 UTC
Fedora 10 changed to end-of-life (EOL) status on 2009-12-17. Fedora 10 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.