Bug 1017682 (CVE-2016-10091) - VUL-0: CVE-2016-10091: UnRTF: stack-based buffer overflows in cmd_* functions
Summary: VUL-0: CVE-2016-10091: UnRTF: stack-based buffer overflows in cmd_* functions
Status: RESOLVED FIXED
Alias: CVE-2016-10091
Product: openSUSE.org
Classification: openSUSE
Component: 3rd party software (show other bugs)
Version: unspecified
Hardware: Other Other
: P3 - Medium : Normal (vote)
Target Milestone: ---
Assignee: E-Mail List
QA Contact: E-mail List
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-01 00:15 UTC by Mikhail Kasimov
Modified: 2022-02-17 16:39 UTC (History)
1 user (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail Kasimov 2017-01-01 00:15:01 UTC
Ref: http://seclists.org/oss-sec/2016/q4/786
===============================================
Hi

As reported by "Skylake" in the Debian bugtracker[1], UnRTF is prone
to stack-based buffer overflows in various cmd_* functions.

    I've found a Stack-based buffer overflow in unrtf 0.21.9, which
    affects three functions including: cmd_expand, cmd_emboss and
    cmd_engrave.

    # convert.c

    static int
    cmd_expand (Word *w, int align, char has_param, int param) {
    char str[10];
    if (has_param) {
    sprintf(str, "%d", param/4); // Overflow, 9-digit negative value triggers the bug
    if (!param)
    attr_pop(ATTR_EXPAND);
    else
    attr_push(ATTR_EXPAND, str);
    }
    return FALSE;
    }

    Apparently writing a negative integer to the buffer can trigger the
    overflow (Minus sign needs an extra byte).

    * How to trigger the bug *

    $ echo "\expnd-400000000" > poc
    $ unrtf poc


A preliminary patch can be found in the Debian bugtracker, but it is
not yet finalized.

Could you assign (a?) CVE as needed? Does one CVE suffice here, since
same class of issue in various cmd_* functions from one reporter?
Whilest, at least in Debian, unrtf is compiled with FORTIFY_SOURCE=2
and the buffer overflows are detected, at least if any exposed
application uses unrtf to process untrusted input, this might lead to
a denial-of-service.

 [1] https://bugs.debian.org/849705

Regards,
Salvatore
===============================================

https://software.opensuse.org/package/unrtf

TW: KDE:KDE3: 0.21.5
42.2: KDE:Extra: 0.21.5 and KDE:KDE3: 0.21.8
42.1: KDE:Extra: 0.21.5 and KDE:KDE3: 0.21.8
13.2: KDE:Extra: 0.21.5 and KDE:KDE3: 0.21.8
Comment 1 Mikhail Kasimov 2017-01-01 09:50:49 UTC
Ref: http://seclists.org/oss-sec/2017/q1/0
============================================
Upstream patch:
http://hg.savannah.gnu.org/hgweb/unrtf/rev/3b16893a6406

Regards,
Salvatore
============================================
Comment 2 Swamp Workflow Management 2017-01-01 23:00:14 UTC
bugbot adjusting priority
Comment 3 Ilya Chernykh 2017-01-02 12:32:08 UTC
Why this bug is assigned to me?
Comment 4 Christophe Marin 2022-02-17 16:39:24 UTC
Fixed in 2017.