Summary: | x11-terms/rxvt-unicode buffer overflow (CAN-2005-0764) | ||
---|---|---|---|
Product: | Gentoo Security | Reporter: | rob holland (RETIRED) <tigger> |
Component: | Vulnerabilities | Assignee: | Gentoo Security <security> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | ciaran.mccreesh, latexer, usata |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | B2 [glsa] jaervosz | ||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | 82737 | ||
Bug Blocks: |
Description
rob holland (RETIRED)
![]() taviso pointed out that I was on drugs (well, very tired) and that not very version we carry is vulnerable. The problem exists in the ebuilded versions for 4.8 and higher, no stable versions are affected. The patch is against 4.7 but should apply happily to other versions (probably with an offset). This is a shiney new version of the fix which should perform better (every time a esc+P is received...woo-hoo...) and also avoids the chance of integer promotion problems by fixing up the type of n. Fix was discussed/developed with help from Yoann Vandoorselaere. Any bugs are mine. rob@leet /tmp/rxvt-unicode-4.7/src $ diff -u command.C command.C.new --- command.C 2004-12-29 19:09:31.000000000 +0000 +++ command.C.new 2005-03-10 10:53:09.696945440 +0000 @@ -3535,7 +3535,7 @@ { unicode_t ch; bool seen_esc = false; - unsigned int n = 0; + size_t n = 0; wchar_t string[STRING_MAX]; while ((ch = cmd_getc ()) != NOCHAR) @@ -3559,7 +3559,7 @@ seen_esc = false; - if (n >= sizeof (string) - 1) + if (n >= (sizeof (string) / sizeof(*string))) // stop at some sane length return NULL; confirmed in >=4.8, that patch fixes the issue here. Current stable version is unaffected. Good catch Rob :) emailed upstream and cc'd security@g.o Thx Rob. Mamoru please fix unstable versions if upstream does not release a fixed version soon. (Sorry I'm now in Taiwan and replying late) I'm not maintaining x11-terms/rxvt-unicode but x11-terms/rxvt. latexer: could you have a look at it? thanks. upstream are releasing a fixed version after cebit :) My patch mistakenly drops something it shouldn't. Corrected path below: rob@leet /tmp/rxvt-unicode-4.7/src $ diff -u command.C command.C.new --- command.C 2004-12-29 19:09:31.000000000 +0000 +++ command.C.new 2005-03-10 10:53:09.696945440 +0000 @@ -3535,7 +3535,7 @@ { unicode_t ch; bool seen_esc = false; - unsigned int n = 0; + size_t n = 0; wchar_t string[STRING_MAX]; while ((ch = cmd_getc ()) != NOCHAR) @@ -3559,7 +3559,7 @@ seen_esc = false; - if (n >= sizeof (string) - 1) + if (n >= ((sizeof (string) / sizeof(*string)) - 1)) // stop at some sane length return NULL; Upstream pointed this out, so they are aware ;) I added 5.3 to the tree, which should contain the fixes. KEYWORDS are ~x86 ~sparc ~amd64 ~ppc. Note that ~mips is stuck at 5.1 pending bug #82737 (just a use.mask). Release public @ http://dist.schmorp.de/rxvt-unicode/Changes 4.8 is affected and stable on ppc so it's not ~, we need a GLSA. ppc: please test and mark x11-terms/rxvt-unicode-5.3 stable stable on ppc Ready for GLSA. This is CAN-2005-0764 GLSA drafted. The CVE id apparently is not reserved yet. GLSA 200503-23 |