Bug 192266

Summary: Attachments with invalid characters in name are not checked for viruses
Product: [Fedora] Fedora Reporter: Patrick Monnerat <patrick>
Component: clamavAssignee: Enrico Scholz <rh-bugzilla>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: medium    
Version: 6CC: Christian.Iseli, extras-qa, njh, triage
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard: bzcl34nup
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2008-05-06 15:55:14 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:
Attachments:
Description Flags
e-mail data to cause the bug
none
Patch to overcome the problem. none

Description Patrick Monnerat 2006-05-18 18:04:04 UTC
Description of problem:
clamav-milter cannot create temporary file if an attachment filename contains a
non-UTF8 character.

Version-Release number of selected component (if applicable):
0.88.2-1

How reproducible:
Always with the attached e-mail

Steps to Reproduce:
1. Send the attached e-mail to a sendmail server that uses clamav-milter
  
Actual results:
2 lines like the following are appended to /var/log/clamd.milter:
LibClamav Error: Can't create temporary file /tmp/clamav-55d9ecef35e0fab5/:
Invalid argument
LibClamav Error: fileblobDestroy: file not saved: report to bugs

Attachment is not checked for viruses.

Expected results:
No log and a proper virus check.

Additional info:
_Procedure rfc2047() processes string encoding, but not the character set (which
is skipped and ignored).
_ As a result, an attachment filename may contain ISO8859-1 characters (in
example), that are not valid UTF8 character.
_ Procedure fileblobSetFilename() uses the attachment name as a base of a
temporary file name, using snprintf() to build the full temporary file path, as
should be accepted by mkstemp().
_ The compilation options used while building the RPM cause the use of a
snprintf version that aborts the current format if an invalid UTF8 character
appears in a string argument, resulting in an invalid temporary filename.

The proposed patch does not fix the character set, but avoid the use of
snprintf() to build the temporary file name, resulting in a legal name (but
still containing invalid utf8 characters): that is sufficient to allow virus
checking in the attachment.

Comment 1 Patrick Monnerat 2006-05-18 18:04:04 UTC
Created attachment 129468 [details]
e-mail data to cause the bug

Comment 2 Patrick Monnerat 2006-05-18 18:08:19 UTC
Created attachment 129469 [details]
Patch to overcome the problem.

This patch does not fix the invalid character(s), but allows the creation of
temporary files. They may however have weird names...

Comment 3 Patrick Monnerat 2006-05-19 14:37:02 UTC
Raising severity to "high", since it may allow a virus designer to bypass clamav
checking.

Comment 4 Patrick Monnerat 2006-07-11 12:47:07 UTC
Problem still present in 0.88.3-1
Patch may be applied as is

Comment 5 Patrick Monnerat 2006-08-10 10:12:39 UTC
Problem still present in 0.88.4-1
Patch may be applied as is

Comment 6 Patrick Monnerat 2006-10-24 10:12:22 UTC
Problem still present in 0.88.5-1
Patch may be applied as is
  By the way: Does anybody uses clamav-milter ??? ;-)

Comment 7 Christian Iseli 2007-01-17 23:20:02 UTC
FC3 and FC4 have now been EOL'd.

Please check the ticket against a current Fedora release, and either adjust the
release number, or close it if appropriate.

Thanks.

Your friendly BZ janitor :-)

Comment 8 Patrick Monnerat 2007-01-18 10:08:52 UTC
Bug still present with clamav-milter-0.88.7-1.fc6
Patch still usable as is

Comment 9 Patrick Monnerat 2007-01-30 18:06:43 UTC
Bug still present with clamav-milter-0.88.7-1.fc6
Patch still usable as is

Comment 10 Nigel Horne 2007-06-09 20:40:07 UTC
The initscript that is shipped with Fedora is not the one supplied upstream by
ClamAV. The upstream version works around the broken Fedora UTF-8 handling by
clearing the LANG variable. I suggest you try that trick.

Comment 11 Bug Zapper 2008-04-04 02:55:05 UTC
Fedora apologizes that these issues have not been resolved yet. We're
sorry it's taken so long for your bug to be properly triaged and acted
on. We appreciate the time you took to report this issue and want to
make sure no important bugs slip through the cracks.

If you're currently running a version of Fedora Core between 1 and 6,
please note that Fedora no longer maintains these releases. We strongly
encourage you to upgrade to a current Fedora release. In order to
refocus our efforts as a project we are flagging all of the open bugs
for releases which are no longer maintained and closing them.
http://fedoraproject.org/wiki/LifeCycle/EOL

If this bug is still open against Fedora Core 1 through 6, thirty days
from now, it will be closed 'WONTFIX'. If you can reporduce this bug in
the latest Fedora version, please change to the respective version. If
you are unable to do this, please add a comment to this bug requesting
the change.

Thanks for your help, and we apologize again that we haven't handled
these issues to this point.

The process we are following is outlined here:
http://fedoraproject.org/wiki/BugZappers/F9CleanUp

We will be following the process here:
http://fedoraproject.org/wiki/BugZappers/HouseKeeping to ensure this
doesn't happen again.

And if you'd like to join the bug triage team to help make things
better, check out http://fedoraproject.org/wiki/BugZappers

Comment 12 Bug Zapper 2008-05-06 15:55:12 UTC
This bug is open for a Fedora version that is no longer maintained and
will not be fixed by Fedora. Therefore we are closing this bug.

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

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