Monday, December 3, 2018

We are pleased to announce the release of ClamAV 0.101.0!  Please take a look at the below release notes for further information.

0.101.0 Release Notes

ClamAV 0.101.0 is a feature release with an assortment of improvements that we've cooked up over the past 6 months.

Highlighted Changes:

  • Our user manual has been converted from latex/pdf/html into Markdown! Markdown is easier to read & edit than latex, and is easier to contribute to as it eliminates the need to generate documents (the PDF, HTML).  The user manual is now shipped in:docs/UserManual[.md].  However, the most up to date version at any time will be on ClamAV.net (This is not live right now, but will be shortly)
  • Support for RAR v5 archive extraction! We replaced the legacy C-based unrar implementation with RarLabs UnRAR 5.6.5 library. Licensing is the same as before, although our libclamunrar_iface supporting library has changed from LGPL to the BSD 3-Clause license.
  • Libclamav API changes:
    • The following scanning functions now require a filename argument.
    • This will enable ClamAV to report more details warning and error information in the future, and will also allow for more sensible temp file names. The filename argument may be NULL if a filename is not available.
      • cl_scandesc
      • cl_scandesc_callback
      • cl_scanmap_callback
  • Scanning options have been converted from a single flag bit-field into a structure of multiple categorized flag bit-fields. This change enabled us to add new scanning options requested by the community. In addition, the name of each scan option has changed a little. As a result, the API changes will require libclamav users to modify how they initialize and pass scan options into calls such as cl_scandesc() .
  • With our move to openssl versions >1.0.1, the cl_cleanup_crypto() function has been deprecated. This is because cleanup of open-ssl init functions is now handled by an auto-deinit procedure within the openssl library, meaning the call to EVP_cleanup() may cause problems to processes external to Clam.
  • CL_SCAN_HEURISTIC_ENCRYPTED scan option was replaced by 2 new scan options:
    • CL_SCAN_HEURISTIC_ENCRYPTED_ARCHIVE
    • CL_SCAN_HEURISTIC_ENCRYPTED_DOC
  • clamd.conf and command line interface (CLI) changes:
    • As in 0.100.2, the clamd.conf OnAccessExtraScanning has been temporarily disabled in order to prevent resource cleanup issues from impacting clamd stability. As noted below, OnAccessExtraScanning is an opt-in minor feature of on-access scanning on Linux systems and its loss does not significantly impact the effectiveness of on-access scanning.  The option still exists, but the feature will not be enabled and a warning will show if LogVerbose is enabled.
    • For details, see: https://bugzilla.clamav.net/show_bug.cgi?id=12048
  • "Heuristic Alerts" (aka "Algorithmic Detection") options have been changed to make the names more consistent. The original options are deprecated in 0.101, and will be removed in a future feature release.
  • In addition, two new scan options were added to alert specifically on encrypted archives or encrypted docs. Previous functionality did both, even though it claimed to be specific to archives:
  • Scan option details:


    | Old `clamd.conf` option          | *New* `clamd.conf` option    |

    | -------------------------------- | ---------------------------- |

    | `AlgorithmicDetection`           | `HeuristicAlerts`            |

    | `DetectBrokenExecutables`        | `AlertBrokenExecutables`     |

    | `PhishingAlwaysBlockCloak`       | `AlertPhishingCloak`         |

    | `PhishingAlwaysBlockSSLMismatch` | `AlertPhishingSSLMismatch`   |

    | `PartitionIntersection`          | `AlertPartitionIntersection` |

    | `BlockMax`                       | `AlertExceedsMax`            |

    | `OLE2BlockMacros`                | `AlertOLE2Macros`            |

    | `ArchiveBlockEncrypted`          | `AlertEncrypted`             |

    |                                  | `AlertEncryptedArchive`      |

    |                                  | `AlertEncryptedDoc`          |



    | Old `clamscan` option        | *New* `clamscan` option          |

    | ---------------------------- | -------------------------------- |

    | `--algorithmic-detection`    | `--heuristic-alerts`             |

    | `--detect-broken`            | `--alert-broken`                 |

    | `--phishing-cloak`           | `--alert-phishing-cloak`         |

    | `--phishing-ssl`             | `--alert-phishing-ssl`           |

    | `--partition-intersection`   | `--alert-partition-intersection` |

    | `--block-max`                | `--alert-exceeds-max`            |

    | `--block-macros`             | `--alert-macros`                 |

    | `--block-encrypted`          | `--alert-encrypted`              |

    |                              | `--alert-encrypted-archive`      |

    |                              | `--alert-encrypted-doc`          |


Some more subtle improvements:


  • Logical signatures have been extended with a new sub-signature type which allows for numerical byte sequence comparison. For those familiar with Snort, this byte comparison feature works similarly to the byte_extract and byte_test feature, in that it allows signature writers to extract and compare a specified number of bytes (offset from a match) against another numeric value. You can read more about this feature, see how it works, and look over examples in our documentation.
  • Backwards compatibility improvements for detecting the OpenSSL dependency.
  • Freshclam updated to match exit codes defined in the freshclam.1 man page.
  • Upgrade from libmspack 0.5alpha to libmspack 0.7.1alpha. As a reminder, we support system-installed versions of libmspack. However, at this time the ClamAV-provided version of libmspack provides additional abilities to parse broken or non-standard CAB files beyond what the stock libmspack 0.7.1alpha provides. We are working with the upstream project to incorporate our modifications, and hopefully these changes will appear in a future release of libmspack.
  • Updated the bundled 3rd party library libxml2 included for Windows builds to version 2.9.8.
  • Updated the bundled 3rd party library pcre included for Windows builds to pcre2 version 10.31.
  • Upgraded Aspack PE unpacking capability with support up to version 2.42.
  • Improvements to PDF parsing capability.
  • Replaced the Windows installer with a new installer built using InnoSetup 5.
  • Improved curl-config detection logic
    • GitHub pull-request by Thomas Petazzoni.
  • Added file type CL_TYPE_LNK to more easily identify Windows Shortcut files when writing signatures.
  • Improved parsing of Windows executable (PE) Authenticode signatures. 
    • Pull request by Andrew Williams.
  • Added support for Authenticode signature properties commonly used by Windows system files. These files are now much more likely to be whitelisted correctly.
  • Signature parsing now works correctly on big endian systems.
  • Some simplification to freshclam mirror management code, including changes to reduce timeout on ignoring mirrors after errors, and to make freshclam more tolerant when there is a delay between the time the new signature database content is announced and the time that the content-delivery-network has the content available for download.
  • Email MIME Header parsing changes to accept argument values with unbalanced quotes. Improvement should improve detection of attachments on malformed emails.
    • GitHub pull request by monnerat.
  • Included the config filename when reporting errors parsing ClamAV configs.
    • GitHub pull request by Josh Soref.
  • Improvement to build scripts for clamav-milter.
    • GitHub pull request by Renato Botelho.

Other changes:

  • Removed option handler for AllowSupplementaryGroups from libfreshclam. This option was previously deprecated from freshclam in ClamAV 0.100.0 but remained in libfreshclam by mistake.
  • In older versions of pcre2 and in pcre, a higher PCRERecMatchLimit may cause
    clamd
    to crash on select files. We have lowered the default PCRERecMatchLimit to 2000 to reduce the likelihood of a crash and have added warnings to recommend using pcre2 v10.30 or higher to eliminate the issue.

Supporting infrastructure:

As you might imagine, ClamAV is much more than just the tarball or EXE you download and install. Here at Cisco Talos, we've been working hard on the support infrastructure that's so easy to take for granted.

  • Test Frameworks
    • Feature Testing:
      • Throughout the development of ClamAV 0.101, our quality assurance engineers have been hard at work rebuilding our QA automation framework in Python from the ground up to test ClamAV features on 32-and-64bit versions:
        • Linux: Ubuntu, Debian, CentOS, Fedora
        • FreeBSD 11
        • Windows 10
    • In addition to building out the framework, they've written over 260 individual feature tests to validate correctness of the new features going into 0.101 as well as to validate many existing features.
  •  Build Acceptance Testing:
    • Another major task accomplished during the development of 0.101 was the creation of a build acceptance test framework that we run from our Jenkins CI server.
  • Similar to the feature testing framework, our build acceptance framework tests across 64bit and 32bit (where available):
    • macOS 10 (.10, .11, .13)
    • Windows (7, 10)
    • Debian (8, 9), Ubuntu (16.04, 18.04), CentOS (6, 7)
    • FreeBSD (10, 11)

This pipeline creates our release materials including the Windows installers, and then validates that the basic install, update, start, scan, and stop procedures all work as expected each time commits are made to our development branches.

  • Signature Database Distribution:
    • During the course of ClamAV 0.101 development, our Community team has been able to migrate us from a network of third-party mirrors over to use the services of CloudFlare to provide a more unified content-delivery-network.
    • With CloudFlare, users in geographic regions that had few mirrors will notice much improved signature update speeds and reliability. In addition, we're excited to be able to finally see user metrics that will help us continue to improve ClamAV. We've observed a 57% improvement in download speeds (on average) across the globe. We are of course grateful to all of the community members who have donated their server bandwidth to mirror the ClamAV signature databases over the years. Thank you so much!  We have not called for an official shutdown of the old mirror network yet.
  • Development Processes:
    • As many of you know, ClamAV 0.100 was in development for a good two years. Not only was this frustrating for users awaiting new features and bug-fixes, it also made for a difficult transition for users that weren't expecting two years worth of change when 0.100 landed.
    • We have learned from the experience and are committed to providing shorter and more responsive ClamAV development cycles.

ClamAV 0.101 is the first of many smaller feature releases where we created a roadmap with distinct deadlines and with specific planned features. We based the feature list on both community requests and our own needs and then executed that plan.

We're very proud of ClamAV 0.101 and we hope you enjoy it.

Acknowledgements:

The ClamAV team thanks the following individuals for their code submissions:
  • Andrew Williams, Cisco Talos
  • Craig Andrews
  • Josh Soref
  • monnerat
  • Renato Botelho
  • tchernomax
  • Thomas Petazzoni
As always, we welcome discussion about ClamAV on our mailing lists.

Monday, November 19, 2018

The ClamAV 0.101.0 release candidate is here!

We have also made significant improvements to our User Manual (the user manual will be moved to clamav.net soon) and to the inline Doxygen documentation in clamav.h for libclamav users. Please take a peek, and consider submitting your own recommendations via GitHub pull-request. In particular, we'd love to expand the Usage section with details on how to integrate ClamAV with other software. Your input would be greatly appreciated.

A short summary of the improvements found in 0.101:

  • Changes to the libclamav API:
    • Those who build applications around our shared library will need to change how they declare and pass scanning options to libclamav. Please take a look at the change to our example code for details. 
    • Scanning functions now have a filename argument. The argument is optional, but improves the efficiency when parsing certain types that require a file on disk to open and read, and will allow for additional improvements in the future.
    • Many of the scanning option #defines have changed. These can be found in our clamav.h header.
    • The libclamav version number has changed.
  • Some of the clamd config and clamscan command line option names have changed. The original versions will still work for a time, but eventually they will be deprecated. These options in question are detailed in the NEWS document.
  • A new sub-signature type called "Byte Compare". Byte Compare sub-signatures can be used to evaluate a numeric value at a given offset from the start of another (matched) sub-signature within the same logical signature. That numerical value may be interpreted from signed ascii decimal, unsigned ascii hex, or unsigned binary data relative to a match offset. For details, see the signature writing documentation.
  • Changes to our documentation. Documentation is now in Markdown and should be easier to navigate and easier to contribute to.
  • Support for extraction/scanning of RAR v5.x archives.


For additional details on changes in 0.101, please read the notes in our NEWS document.

Thank you in advance for test-driving the ClamAV 0.101 release candidate! Bugs should be brought to our attention via the clamav-devel mailing list or via bugzilla.

Tuesday, October 30, 2018

Welcome to the ClamAV 0.101.0 beta!

Important notes about this release:


  • Changes to the libclamav API:
    • Those who build applications around our shared library will need to change how they declare and pass scanning options to libclamav. Please take a look at the change to our example code for details. 
    • Many of the scanning option #defines have changed. These can be found in our clamav.h header.
    • The libclamav version number has changed.
  • Some of the clamd config and clamscan command line option names have changed. The original versions will still work for a time, but eventually they will be deprecated. These options in question are detailed in the NEWS document.
  • A new sub-signature type called "Byte Compare". Byte Compare sub-signatures can be used to evaluate a numeric value at a given offset from the start of another (matched) sub-signature within the same logical signature. That numerical value may be interpreted from signed ascii decimal, unsigned ascii hex, or unsigned binary data relative to a match offset. Your participation in testing this feature during our beta period will be greatly appreciated. For details, see the signature writing documentation.
  • Changes to our documentation. Documentation is now in Markdown and should be easier to navigate and easier to contribute to.
  • Support for extraction/scanning of RAR v5.x archives.


For additional details on changes in 0.101, please read the notes in our NEWS document.

Thank you in advance for participating in the ClamAV 0.101 beta! Bugs should be brought to our attention via the clamav-devel mailing list or via bugzilla.

You may download the ClamAV 0.101.0 beta at the usual location on ClamAV.net.

Wednesday, October 3, 2018

ClamAV 0.100.2 has been released! This is a patch release to address several vulnerabilities.
  • Fixes for the following ClamAV vulnerabilities:
    • CVE-2018-15378:
      • Vulnerability in ClamAV's MEW unpacking feature that could allow an unauthenticated, remote attacker to cause a denial-of-service (DoS) condition on an affected device.
      • Reported by Secunia Research at Flexera.
    • Fix for a two-byte buffer over-read bug in ClamAV's PDF parsing code.
      • Reported by Alex Gaynor.
    • Fixes for the following vulnerabilities in bundled third-party libraries:
    • CVE-2018-14680:
      • An issue was discovered in mspack/chmd.c in libmspack before 0.7alpha. It does not reject blank CHM filenames.
    • CVE-2018-14681:
      • An issue was discovered in kwajd_read_headers in mspack/kwajd.c in libmspack before 0.7alpha. Bad KWAJ file header extensions could cause a one- or two-byte overwrite.
    • CVE-2018-14682:
      • An issue was discovered in mspack/chmd.c in libmspack before 0.7alpha. There is an off-by-one error in the TOLOWER() macro for CHM decompression. Additionally, 0.100.2 reverted 0.100.1's patch for CVE-2018-14679, and applied libmspack's version of the fix in its place
  • Other changes:
    • Some users have reported freshclam signature update failures as a result of a delay between the time the new signature database content is announced and the time that the content-delivery-network has the content available for download. To mitigate these errors, this patch release includes some modifications to freshclam to make it more lenient, and to reduce the time that freshclam will ignore a mirror when it detects an issue.
    • On-Access "Extra Scanning," an opt-in minor feature of OnAccess scanning on Linux systems, has been disabled due to a known issue with resource cleanup OnAccessExtraScanning will be re-enabled in a future release when the issue is resolved. In the mean-time, users who enabled the feature in clamd.conf will see a warning informing them that the feature is not active. For details, click here.
Thank you to the following ClamAV community members for your code submissions
and bug reports:

- Alex Gaynor
- Hiroya Ito
- Laurent Delosieres, Secunia Research at Flexera

Thursday, September 13, 2018

Executive summary

ClamAV Signature Creator (CASC) is an IDA Pro plugin that assists in the creation of ClamAV pattern signatures. We have enhanced this plugin to also analyze these signatures. The plugin highlights matching parts in a binary when its given a particular signature. This function is helpful when evaluating automatically generated signatures, e.g., from the BASS framework. As a larger number of signatures is automatically generated, it becomes ever more important to gain a quick understanding about the effects of these signatures. This functionality will allow us to check the accuracy of our signatures faster, and allow us to deliver a better product to our users.

Description

The signature analysis function integrates neatly into the existing CASC plugin. Because the signature analyzer (“SigAnalyzer”) function needs some extra libraries, the installation of the plugin changes slightly — you can install the library dependencies via your distribution if you use the system Python (e.g., on Linux on a 32-bit machine for any IDA version or on Linux with IDA 7.0 on a 64-bit machine), or you can use the provided ZIP archives with bundled library dependencies. Detailed installation instructions for both cases can be found in the project’s README.

If the library dependencies are satisfied, you’ll have a new tab “Analyze” next to the tab “Create” in the plugin’s pane. Here, you can paste a logical signature (ldb) or pattern signature (ndb), and press “Add signature.” The signature will appear in the “Signatures” list above if it parsed correctly. If nothing happens, keep an eye on error messages in IDA’s output window. Now you can double-click the signature in the list. For an ndb signature, this will directly take you to the match in the IDA-View window. The match is green-colored.

An ldb signature will show all sub-signatures on the right list instead. You can double-click on a sub-signature, and it will color the match and bring you to it. Keep an eye on the text row above the “Add signature” button — you can find more information on the match there, or a message if there is no match. Added signatures are stored inside the database, and will be available again in the signature selection window the next time you open the database.

Internally, the plugin relies on Yara-python to find matches. ClamAV signatures are translated to Yara rules, which are then matched against the binary data. The plugin’s source code is available on our GitHub page, as well as in installation packages for your convenience. Please go ahead and test the new functionality, but keep in mind that the functionality is in an early beta stage, and still may have a bug or two. If you come across a bug, or you want to comment, please don't hesitate to let us know through a GitHub issue.

We are excited to have our users use this new feature. Please continue to follow along on the blog for new ClamAV features as we develop them, and be sure to follow us on Twitter.


Wednesday, September 5, 2018

At Cisco Talos, we regularly get questions on how to get the most out of ClamAV. Therefore, we wanted to point out some common mistakes that users make in hopes that we can make using ClamAV easier, and more effective, for everyone.

Downloading the signatures

We want to emphasize the importance of using FreshClam to download the signatures instead of Wget, Python, or similar scripting libraries. A lot of folks from the community are attempting to download the daily, bytecode, and the main CVDs using scripting tools. While we understand the desire to do so, FreshClam has been engineered to take advantage of the fact that our publishing system provides "diff" files, or only what has changed since the last update.

This provides faster updates to the world, reduces our overhead on the server side, and lowers our overall bandwidth. This problem was not made apparent until we consolidated the mirror infrastructure to our CDN (Cloudflare). We are now able to observe download problems across our infrastructure.

For example, we have roughly 20 individual IPs that are attempting to download the whole main.cvd, daily.cvd, and bytecode.cvd files roughly, eight times a minute. Imagine what would happen if we were able to get users to stop doing that and use FreshClam. We are currently pushing about 54TB a day in updates to our users — you have to wonder how much that would drop if everyone was using FreshClam.

ClamAV supported versions

We took a look at the top 10 "User-Agents" that are downloading updates.
ClamAV/0.100.1 (OS: linux-gnu, ARCH: x86_64, CPU: x86_64)
ClamAV/0.99.4 (OS: linux-gnu, ARCH: x86_64, CPU: x86_64)
ClamAV/0.99.2 (OS: linux-gnu, ARCH: x86_64, CPU: x86_64)
ClamAV/0.98.7 (OS: linux-gnu, ARCH: x86_64, CPU: x86_64)
ClamAV/0.100.0 (OS: linux-gnu, ARCH: x86_64, CPU: x86_64)
ClamWin/0.99.1 (OS: win32, ARCH: i386, CPU: i386)
ClamWin/0.99.4 (OS: win32, ARCH: i386, CPU: i386)
ClamAV/0.99.3 (OS: linux-gnu, ARCH: x86_64, CPU: x86_64)
Wget/1.12 (linux-gnu)
ClamAV/0.96-exp (OS: linux-gnu, ARCH: i386, CPU: i686)
Since we already covered Wget and tools like that, let's move on to older versions of ClamAV.

As you can see, the top two versions are the most recent versions and essentially, the last major version back. These are Ubuntu/Debian users. We work very closely with the package maintainer for those distributions, and we can see the shift in versions when they update.

Let's shift our focus to No. 10 in the list above. ClamAV/0.96-exp, an experimental version of ClamAV back in the 0.96 days, before CVD diff'ing was released. Obviously, this is an errant cronjob (someone attempting to run FreshClam once a minute). Again, we are asking users to please update to a new version of ClamAV, which will, in turn, update your version of FreshClam (to support diff'ing).

We took the logs, removed Wget, curl and other scripting tools, only focusing on actual FreshClam installations, only focusing on versions of ClamAV.  Basically, asking our logs, "How many different versions of ClamAV are there out there?"

297

After ClamAV is installed, then what? How do I update the database?

You will want to edit freshclam.conf.example by commenting out the "example" text with a pound symbol (#).

Once that is done, run a 'freshclam' via command line and the database should update.

We also want to remind people that we do monitor IRC, so if you need help — give us a shout.

Community members and staff idle the channel and try to help to the best of our abilities.

IRC information

Service: irc.freenode.net
Channel: #clamav

How do you submit bugs to ClamAV?

Please visit https://bugzilla.clamav.net/.

If you are having Mirror issues

If you are running into an issue when using FreshClam to download the signatures, it could be the mirror.dat file. Try deleting this file, and then running FreshClam again.

In the "configure" file of FreshClam, you can set your mirror as 'database.clamav.net' instead of using a country code (db.xy.clamav.net).  In a future version of ClamAV, we will improve/remove the mentions of country based mirrors. Use database.clamav.net as the central point for your downloads.

If you want to contribute to documentation

Our documentation is also open-source. Feel free to edit it as need be, and submit the changes to our Git repository.

Monday, July 30, 2018

If you use ClamAV’s Git repository, you may have noticed that we’ve recently changed our Git workflow.


It’s a big departure from what we had been doing, and we believe it will be a major improvement. Our new workflow took inspiration from the popular and well-known GitFlow model, and it shares some of its features. However, to better suit our needs, we’ve made a number of modifications and simplifications to the original GitFlow paradigm. Here’s a rundown of some of the most important changes:

  1. New commits will go into dev/0.101 instead of master.  The default branch will now be dev/0.101.
    • When unit tests, system tests, and regression tests on dev/0.101 are up to snuff, we will cherry-pick the commits over to master. This way, master will always be stable. 
  2. When we’re ready to release, we will create a release branch (rel/0.101) from master and tag the release (0.101.0). 
  3. A new dev branch will be created for the next feature release (dev/0.102) and will be set as the default branch. 
  4. Any urgent security or bug-fix patches will be applied both to the new dev branch (dev/0.102) and to the previous dev branch (dev/0.101).  
    • After successful testing on dev/0.100, the patch(es) will be cherry-picked to rel/0.101 and tagged for the patch version release (0.101.1). 
    • Meanwhile, the same urgent patch(es) will undergo normal testing in the current dev branch (dev/0.102). Security related patches will remain private until the patch version release is published.
  5. The goal going forward is for master to always be stable, so we can publish releases as frequently as needed.  With this workflow and versioning scheme, it will also be easy to create patch releases. 

As a disclaimer:  We’re just getting started with the new Git workflow, which means that master isn’t proven stable yet. Also, we have some major automation improvements to make to our system and regression-testing processes that will make this workflow highly effective. The automation improvements are still in the works, and are probably a couple months out. Until then, any testing done before we cherry-pick changes to master will be mostly manual.


The takeaway from this is that these are the important branches in the ClamAV Git repository:
  • dev/0.101 — The latest unstable code in development.
  • master — The latest tested stable code.
  • rel/0.100 — The latest released version, which is also posted on clamav.net.
  • dev/0.100 — The previous development branch, used to test hotfixes prior to a patch release. 
For any further questions or discussion please head on over to our ClamAV-devel mailing list
http://lists.clamav.net/mailman/listinfo/clamav-devel

Thank you.