Summary: | Buffer overflows in fortune's strfile, unstr and randstr | ||||||
---|---|---|---|---|---|---|---|
Product: | Base System | Reporter: | Shlomi Fish <shlomif> | ||||
Component: | bin | Assignee: | Mark Johnston <markj> | ||||
Status: | Closed FIXED | ||||||
Severity: | Affects Only Me | CC: | akos.somfai, emaste, markj | ||||
Priority: | --- | ||||||
Version: | CURRENT | ||||||
Hardware: | Any | ||||||
OS: | Any | ||||||
Attachments: |
|
Description
Shlomi Fish
2020-04-30 11:26:31 UTC
A better fix would be 'svn rm usr.bin/fortune'. An update: in addition, an integer overflow when calculating the percentages was found: https://github.com/shlomif/fortune-mod/commit/acd338098071bddfa1d21f87e1813727031428ea It may or may not be exploitable. Created attachment 215637 [details]
proposed patch for fortune and strfile
Fixing possible buffer overflow in strfile and integer overflow in fortune. Other files under fortune/ seem not affected by these problems.
Attaching patch.
Anyone interested in commiting the patch? A commit references this bug: Author: markj Date: Mon Aug 10 17:01:59 UTC 2020 New revision: 364083 URL: https://svnweb.freebsd.org/changeset/base/364083 Log: fortune, strfile: Improve validation of command-line arguments. - Avoid potential overflow when parsing a percentage. - Avoid truncation when copying file paths. PR: 246050 Submitted by: Akos Somfai <akos.somfai@gmail.com> (original) MFC after: 1 week Changes: head/usr.bin/fortune/fortune/fortune.c head/usr.bin/fortune/strfile/strfile.c A commit references this bug: Author: markj Date: Mon Aug 17 12:38:35 UTC 2020 New revision: 364298 URL: https://svnweb.freebsd.org/changeset/base/364298 Log: MFC r364083: fortune, strfile: Improve validation of command-line arguments. PR: 246050 Changes: _U stable/12/ stable/12/usr.bin/fortune/fortune/fortune.c stable/12/usr.bin/fortune/strfile/strfile.c Thanks for the patch. |