Your message dated Sat, 21 Apr 2012 08:51:44 +0000
with message-id <[email protected]>
and subject line Bug#668227: fixed in links2 2.6-1
has caused the Debian Bug report #668227,
regarding links2: security bugs in links
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
668227: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=668227
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: links2
Version: 2.3~pre1-1
Severity: grave
Tags: security
Justification: user security hole

I discovered some out of memory accesses in links2 graphics mode that could be
potentially used to run exploits. I fixed them in links-2.6. For Debian
Squeeze, I am sending this patch that backports the fixes to links-2.3pre1.
Apply the patch and distribute patched packages links and links2 through
security.debian.org.



-- System Information:
Debian Release: 6.0.4
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)

Kernel: Linux 3.3.0 (SMP w/8 CPU cores; PREEMPT)
Locale: LANG=cs_CZ, LC_CTYPE=cs_CZ (charmap=ISO-8859-2)
Shell: /bin/sh linked to /bin/dash

Versions of packages links2 depends on:
ii  libc6                  2.11.3-2          Embedded GNU C Library: Shared lib
ii  libdirectfb-1.2-9      1.2.10.0-4        direct frame buffer graphics - sha
ii  libgpm2                1.20.4-3.3        General Purpose Mouse - shared lib
ii  libjpeg62              6b1-1             The Independent JPEG Group's JPEG 
ii  libpng12-0             1.2.44-1+squeeze4 PNG library - runtime
ii  libssl0.9.8            0.9.8o-4squeeze7  SSL shared libraries
ii  libsvga1               1:1.4.3-29        console SVGA display libraries
ii  libtiff4               3.9.6             Empty libtiff4 package
ii  libx11-6               2:1.3.3-4         X11 client-side library
ii  zlib1g                 1:1.2.3.4.dfsg-3  compression library - runtime

links2 recommends no packages.

links2 suggests no packages.

-- no debconf information
This patch fixes:

Buffer overflow when pasting too long text from clipboard to dialog boxes
        (not remotely exploitable)
A write out of allocated memory in the graphics rendeder (potentionally
        exploitable)
An infinite loop when parsing invalid usemap specification in text and
        graphics mode (can cause browser lockup, but not otherwise exploitable)
Accesses out of memory in the xbm decoder (potentionally exploitable)

---
 bfu.c  |    3 ++-
 dip.c  |    3 ++-
 html.c |    6 +++++-
 xbm.c  |   20 ++++++++++----------
 4 files changed, 19 insertions(+), 13 deletions(-)

Index: links-2.3pre1/bfu.c
===================================================================
--- links-2.3pre1.orig/bfu.c    2012-04-09 23:39:47.000000000 +0200
+++ links-2.3pre1/bfu.c 2012-04-09 23:39:56.000000000 +0200
@@ -1382,7 +1382,8 @@ void dialog_func(struct window *win, str
 clipbd_paste:
                                        clipboard = get_clipboard_text(term);
                                        if (clipboard) {
-                                               if (strlen(di->cdata) < 
di->item->dlen - strlen(clipboard)) {
+                                               if (strlen(di->cdata) + 
strlen(clipboard) < (size_t)di->item->dlen ||
+                                                   strlen(di->cdata) + 
strlen(clipboard) < strlen(di->cdata)) {
                                                        memmove(di->cdata + 
di->cpos + strlen(clipboard), di->cdata + di->cpos, strlen(di->cdata) - 
di->cpos + 1);
                                                        
memcpy(&di->cdata[di->cpos], clipboard, strlen(clipboard));
                                                        di->cpos += 
strlen(clipboard);
Index: links-2.3pre1/dip.c
===================================================================
--- links-2.3pre1.orig/dip.c    2012-04-09 23:39:47.000000000 +0200
+++ links-2.3pre1/dip.c 2012-04-09 23:39:56.000000000 +0200
@@ -1901,6 +1901,7 @@ int g_wrap_text(struct wrap_struct *w)
        while (*w->text) {
                int u;
                int s;
+               unsigned char *l_text = w->text;
                if (*w->text == ' ') w->last_wrap = w->text,
                                     w->last_wrap_obj = w->obj;
                GET_UTF_8(w->text, u);
@@ -1913,7 +1914,7 @@ int g_wrap_text(struct wrap_struct *w)
                        if (u != 0xad || *w->text == ' ') continue;
                        s = g_char_width(w->style, '-');
                        if (w->pos + s <= w->width || (!w->last_wrap && 
!w->last_wrap_obj)) {
-                               w->last_wrap = w->text;
+                               w->last_wrap = l_text;
                                w->last_wrap_obj = w->obj;
                                continue;
                        }
Index: links-2.3pre1/html.c
===================================================================
--- links-2.3pre1.orig/html.c   2012-04-09 23:39:47.000000000 +0200
+++ links-2.3pre1/html.c        2012-04-09 23:39:56.000000000 +0200
@@ -2920,6 +2920,7 @@ int get_image_map(unsigned char *head, u
                lblen = 0;
                se3:
                ss = s;
+               se4:
                while (ss < eof && *ss != '<') ss++;
                if (ss >= eof) {
                        mem_free(label);
@@ -2933,7 +2934,10 @@ int get_image_map(unsigned char *head, u
                        s = skip_comment(s, eof);
                        goto se3;
                }
-               if (parse_element(s, eof, NULL, NULL, NULL, &ss)) goto se3;
+               if (parse_element(s, eof, NULL, NULL, NULL, &ss)) {
+                       ss = s + 1;
+                       goto se4;
+               }
                if (!((namelen == 1 && !casecmp(name, "A", 1)) ||
                      (namelen == 2 && !casecmp(name, "/A", 2)) ||
                      (namelen == 3 && !casecmp(name, "MAP", 3)) ||
Index: links-2.3pre1/xbm.c
===================================================================
--- links-2.3pre1.orig/xbm.c    2012-04-09 23:39:47.000000000 +0200
+++ links-2.3pre1/xbm.c 2012-04-09 23:39:56.000000000 +0200
@@ -44,7 +44,7 @@ struct xbm_decoder{
 extern int get_foreground(int rgb);
 
 unsigned char *my_memmem(unsigned char *, int, unsigned char *, int);
-void xbm_decode(struct cached_image *, unsigned char *, int);
+int xbm_decode(struct cached_image *, unsigned char *, int);
 
 
 unsigned char *my_memmem(unsigned char *h, int hl, unsigned char *n, int nl)
@@ -138,7 +138,7 @@ static inline void put_eight(struct cach
 
 /* opravdovy dekoder xbm, data jsou bez komentaru */
 /* length is always !=NULL */
-void xbm_decode(struct cached_image *cimg, unsigned char *data, int length)
+int xbm_decode(struct cached_image *cimg, unsigned char *data, int length)
 {
        struct xbm_decoder *deco=(struct xbm_decoder *)cimg->decoder;
        /* okurky v decu ;-) */
@@ -146,13 +146,13 @@ void xbm_decode(struct cached_image *cim
        int must_return=0;
 
 restart_again:
-       if (must_return&&!length)return;
+       if (must_return&&!length)return 0;
        must_return=0;
        a=min(length,XBM_BUFFER_LEN-deco->buffer_pos);
        memcpy(deco->buffer+deco->buffer_pos,data,a);
        length-=a;
        deco->buffer_pos+=a;
-       if (!deco->buffer_pos)return;   /* z toho nic plodnyho nevznikne */
+       if (!deco->buffer_pos)return 0;         /* z toho nic plodnyho 
nevznikne */
        data+=a;
        if (!deco->in_data_block&&deco->partnum)
        {
@@ -220,7 +220,7 @@ restart_again:
                        cimg->green_gamma=display_green_gamma;
                        cimg->blue_gamma=display_blue_gamma;
                        cimg->strip_optimized=0;
-                       if (header_dimensions_known(cimg)) 
{img_end(cimg);return;}
+                       if (header_dimensions_known(cimg)) 
{img_end(cimg);return 1;}
                        
                        deco->in_data_block=1;
                        p++;
@@ -239,7 +239,7 @@ restart_again:
                deco->buffer_pos=a;
                if (deco->partnum)must_return=1;
                else 
put_eight(cimg,(b==16&&d>2)||(b==10&&deco->actual_eight>255)?16:8);
-               if (deco->image_pos>=deco->pixels) {img_end(cimg);return;}
+               if (deco->image_pos>=deco->pixels) {img_end(cimg);return 1;}
                goto restart_again;
                
        }
@@ -261,9 +261,9 @@ cycle_again:
                        unsigned char *p;
                        p=memchr(data,'/',length);
                        if (!p){xbm_decode(cimg, data, length);return;}
-                       xbm_decode(cimg, data, p-data);
-                       data=p+1;       /* preskocim lomitko */
+                       if (xbm_decode(cimg, data, p-data)) return;
                        length-=p-data+1;
+                       data=p+1;       /* preskocim lomitko */
                        deco->state=1;
                        goto cycle_again;
                }
@@ -271,7 +271,7 @@ cycle_again:
                case 1: /* za 1. lomitkem */
                {
                        if (*data=='*'){deco->state=2;data++;length--;goto 
cycle_again;}        /* zacal komentar */
-                       xbm_decode(cimg, "/", 1);
+                       if (xbm_decode(cimg, "/", 1)) return;
                        deco->state=0;  /* to nebyl komentar */
                        goto cycle_again;
                }
@@ -281,8 +281,8 @@ cycle_again:
                        unsigned char *p;
                        p=memchr(data,'*',length);
                        if (!p)return;  /* furt komentar */
-                       data=p+1;       /* preskocim hvezdicku */
                        length-=p-data+1;
+                       data=p+1;       /* preskocim hvezdicku */
                        deco->state=3;
                        goto cycle_again;
                }

--- End Message ---
--- Begin Message ---
Source: links2
Source-Version: 2.6-1

We believe that the bug you reported is fixed in the latest version of
links2, which is due to be installed in the Debian FTP archive:

links2_2.6-1.debian.tar.gz
  to main/l/links2/links2_2.6-1.debian.tar.gz
links2_2.6-1.dsc
  to main/l/links2/links2_2.6-1.dsc
links2_2.6-1_amd64.deb
  to main/l/links2/links2_2.6-1_amd64.deb
links2_2.6.orig.tar.bz2
  to main/l/links2/links2_2.6.orig.tar.bz2
links_2.6-1_amd64.deb
  to main/l/links2/links_2.6-1_amd64.deb



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to [email protected],
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Axel Beckert <[email protected]> (supplier of updated links2 package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing [email protected])


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Format: 1.8
Date: Sat, 21 Apr 2012 09:47:46 +0200
Source: links2
Binary: links2 links
Architecture: source amd64
Version: 2.6-1
Distribution: unstable
Urgency: medium
Maintainer: Axel Beckert <[email protected]>
Changed-By: Axel Beckert <[email protected]>
Description: 
 links      - Web browser running in text mode
 links2     - Web browser running in both graphics and text mode
Closes: 654807 668227
Changes: 
 links2 (2.6-1) unstable; urgency=medium
 .
   * New upstream release
     + Fixes several possibly remotely exploitable security issues (Closes:
       #668227; set urgency=medium due to security bug fixes)
     + Refresh the following patches:
       - links2-instead-of-links.diff
       - x-terminal-emulator-instead-of-xterm.diff
       - fix-typos-in-manpage.diff
       - improve-message-of-dash-g-602227.diff
       - verify-ssl-certs-510417.diff
     + Imported new ipv6.diff from patch upstream.
     + Removed BUGS and TODO from debian/docs, they no more exists in upstream
       tarball. Added AUTHORS instead.
   * Enable hardened build flags (Closes: #654807) Thanks Moritz
     Muehlenhoff!
   * Enable bzip2 and lzma support by adding according build dependencies
   * Replaced build-dependendy on libgpmg1-dev by libgpm-dev
   * Replaced incomplete linux-only architecture list in build-dependency
     with "linux-any"
   * Broadened architecture constraints for the libsvga1-dev build-dependency
     since svgalib has been ported to non-x86 architectures as well as to
     kfreebsd.
   * Updated lintian overrides for spelling error false positives in
     translations.
   * Bumped Standards-Version to 3.9.3 (no changes)
Checksums-Sha1: 
 cc7ae6c0547bafbb6172d92797fe8e217b85cc15 1456 links2_2.6-1.dsc
 228bd726c176ea44d35fa12cafd97aa83214d9dc 3866614 links2_2.6.orig.tar.bz2
 3dc93e376f2ccf27e159933a6cd3210e5b25f6fb 22580 links2_2.6-1.debian.tar.gz
 f07ed5816ca63c70a64a9883894939c82417e05c 2006998 links2_2.6-1_amd64.deb
 7301e0b676ba553757987523454428d96812c916 508182 links_2.6-1_amd64.deb
Checksums-Sha256: 
 25b7f805728cf655d8eb6d74187085de9ebc3e1790385b1ba369b7b6a9e5857b 1456 
links2_2.6-1.dsc
 df9149f5f50d0b7742f6b3972b0fc0e9ff091ad4ef27153a3362a9ac1033835b 3866614 
links2_2.6.orig.tar.bz2
 df85da0fe814fa8d848225cf403a4dd726ea0d269ab7466bc3b7c60c3a208f8b 22580 
links2_2.6-1.debian.tar.gz
 e4272291d9de2c8a5276f308405f12e0f482acc50526ba17e12ed4b3ee9d3193 2006998 
links2_2.6-1_amd64.deb
 6bb7e880d6200b61928c87a3a57631af086e21db3822cf67c51f1d68c82c1a2b 508182 
links_2.6-1_amd64.deb
Files: 
 3ac5f230bb864141b05d768e3806d41f 1456 web optional links2_2.6-1.dsc
 9129e7e3b5c554458b9666689248e0c7 3866614 web optional links2_2.6.orig.tar.bz2
 048031cb64373ea47a3dd6dcbc3fe21d 22580 web optional links2_2.6-1.debian.tar.gz
 a78c60057e0aeab4d7814ee04864c165 2006998 web optional links2_2.6-1_amd64.deb
 d343f0f8f819f7fc71d6b032a1ca7b02 508182 web optional links_2.6-1_amd64.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAk+SbBUACgkQwJ4diZWTDt7SrACfU9b94UPOUJxkSMXvIqUIFhOG
4GQAnRFStTQyGqCnlV50jyiRh4PssTNk
=rcVm
-----END PGP SIGNATURE-----



--- End Message ---

Reply via email to