GnuCash
Contact   Instructions
Bug 796777 - CVE-2008-1391: Integer overflow in included strfmon function
Summary: CVE-2008-1391: Integer overflow in included strfmon function
Status: RESOLVED FIXED
Alias: None
Product: GnuCash
Classification: Unclassified
Component: General (show other bugs)
Version: git-master
Hardware: PC Other
: Normal normal
Target Milestone: ---
Assignee: general
QA Contact: general
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-23 05:59 EDT by J.Zaitseff@zap.org.au
Modified: 2018-08-17 10:38 EDT (History)
3 users (show)

See Also:


Attachments
strfmon.c from FreeBSD 11.2 (15.88 KB, text/x-csrc)
2018-07-23 05:59 EDT, J.Zaitseff@zap.org.au
no flags Details

Description J.Zaitseff@zap.org.au 2018-07-23 05:59:14 EDT
Created attachment 372926 [details]
strfmon.c from FreeBSD 11.2

The file borrowed/libc/strfmon.c has a known integer overflow vulnerability (CVE-2008-1391), as documented in, for example:

  https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2008-1391
  https://securitytracker.com/id/1019722
  https://www.exploit-db.com/exploits/31550/

This file, strfmon.c, was originally taken from FreeBSD.  Any version of FreeBSD after 2011 has a fix included.  The version of strfmon.c in Gnucash should be updated to this latest version (included as an attachment), although the changed header includes mean some small work will need to be done to integrate it as a patch.

This bug is present not only in the current git HEAD, as well as released 3.x versions, but also in at least Gnucash 2.6.19 as distributed by Debian and Ubuntu.
Comment 1 Geert Janssens 2018-08-17 10:38:09 EDT
Thank you for your report.

As we only use strfmon in one specific code spot, I took this as an opportunity to drop our dependency on it completely.
The functionality it provided is now implemented via stdlibc++ (c++11) standard conversion functions.

The new implementation will be part of gnucash 3.3.

If someone would want to backport this to earlier releases in the 3.x series, the relevant two commits are
https://github.com/Gnucash/gnucash/commit/34cb4925a4be639e8d3e211ce2020d2190d5a41d
https://github.com/Gnucash/gnucash/commit/54a5097c60496d005f497b2315f063734d8bcd9f

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