First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 108451
Alias:
Product:
Component:
Status: RESOLVED
Resolution: FIXED
Assigned To: Gentoo Security <security@gentoo.org>
Hardware:
OS:
Version:
Priority:
Severity:
Reporter: Sune Kloppenborg Jeppesen <jaervosz@gentoo.org>
Add CC:
CC:
Remove selected CCs
URL:
Summary:
Status Whiteboard:
Keywords:
Flags: Requestee:
 
 
  ()

Filename Description Type Creator Created Size Actions
lynx.security.patch lynx.security.patch patch Sune Kloppenborg Jeppesen 2005-10-08 00:00 0000 637 bytes Details | Diff
lynx-2.8.5-r1.ebuild new ebuild for lynx text/plain Seemant Kulleen (RETIRED) 2005-10-12 06:35 0000 1.95 KB Details
lynx-2.8.5-CAN-2005-3120.patch Thomas Dickey's patch, back-ported to 2.8.5 patch Seemant Kulleen (RETIRED) 2005-10-12 06:35 0000 10.15 KB Details | Diff
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 108451 depends on: Show dependency tree
Bug 108451 blocks:

Additional Comments: (this is where you put emerge --info)


Not eligible to see or edit group visibility for this bug.






View Bug Activity   |   Format For Printing   |   XML   |   Clone This Bug


Description:   Opened: 2005-10-07 23:59 0000
I have found a remote buffer overflow in Lynx. It occurs when a Lynx 
user selects malicious links or simply visits malicious web pages! 
 
When Lynx connects to an NNTP server to fetch information about the 
available articles in a newsgroup, it will call a function called 
HTrjis() with the information from certain article headers. The 
function adds missing ESC characters to certain data, to support 
Asian character sets. However, it does not check if it writes outside 
of the char array buf, and that causes a remote stack-based buffer 
overflow, with full control over EIP, EBX, EBP, ESI and EDI. 
 
Two attack vectors to make a victim visit a URL to a dangerous news 
server are: (a) *redirecting scripts*, where the victim visits some 
web page and it redirects automatically to a malicious URL, and 
(b) *links in web pages*, where the victim visits some web page 
and selects a link on the page to a malicious URL. Attack vector 
(b) is helped by the fact that Lynx does not automatically display 
where links lead to, unlike many graphical web browsers. 
 
A victim is in danger when his or her Lynx session is forced to 
visit a URL of the types "nntp://some.news.server/group.name" or 
"news:group.name", and the server that Lynx connects to must send 
back article headers with certain malicious data. It may be possible 
to make real news servers distribute such articles without technical 
problems, but that has not been tested. 
 
The vulnerable versions are at least 2.8.5, 2.8.6dev.13, 2.8.4 and 
2.8.3. The old version 2.8.2 is not vulnerable. 
 
I have attached a malicious NNTP server that exhibits this 
problem. (As noted above, it might be possible to exploit 
this issue through legitimate news servers as well.) You just 
run this server, then you start Lynx with a URL of the type 
"nntp://malicious.server/group.name", and it will crash immediately. 
 
To test the attack vectors, I have also included a redirecting 
script and a web page with a link to a malicious server. 
 
Finally, I have attached a patch for this issue. It simply stops 
copying when it comes close to the end of the array. (I thought 
about expanding the size of the array, but I thought that might 
have repercussions in other parts of the code.) 
 
I hope that we can coordinate our respective updates for Lynx by 
agreeing on a release date. 
 
// Ulf Harnhammar for the Debian Security Audit Project 

------- Comment #1 From Sune Kloppenborg Jeppesen 2005-10-07 23:59:27 0000 -------
I have found a remote buffer overflow in Lynx. It occurs when a Lynx 
user selects malicious links or simply visits malicious web pages! 
 
When Lynx connects to an NNTP server to fetch information about the 
available articles in a newsgroup, it will call a function called 
HTrjis() with the information from certain article headers. The 
function adds missing ESC characters to certain data, to support 
Asian character sets. However, it does not check if it writes outside 
of the char array buf, and that causes a remote stack-based buffer 
overflow, with full control over EIP, EBX, EBP, ESI and EDI. 
 
Two attack vectors to make a victim visit a URL to a dangerous news 
server are: (a) *redirecting scripts*, where the victim visits some 
web page and it redirects automatically to a malicious URL, and 
(b) *links in web pages*, where the victim visits some web page 
and selects a link on the page to a malicious URL. Attack vector 
(b) is helped by the fact that Lynx does not automatically display 
where links lead to, unlike many graphical web browsers. 
 
A victim is in danger when his or her Lynx session is forced to 
visit a URL of the types "nntp://some.news.server/group.name" or 
"news:group.name", and the server that Lynx connects to must send 
back article headers with certain malicious data. It may be possible 
to make real news servers distribute such articles without technical 
problems, but that has not been tested. 
 
The vulnerable versions are at least 2.8.5, 2.8.6dev.13, 2.8.4 and 
2.8.3. The old version 2.8.2 is not vulnerable. 
 
I have attached a malicious NNTP server that exhibits this 
problem. (As noted above, it might be possible to exploit 
this issue through legitimate news servers as well.) You just 
run this server, then you start Lynx with a URL of the type 
"nntp://malicious.server/group.name", and it will crash immediately. 
 
To test the attack vectors, I have also included a redirecting 
script and a web page with a link to a malicious server. 
 
Finally, I have attached a patch for this issue. It simply stops 
copying when it comes close to the end of the array. (I thought 
about expanding the size of the array, but I thought that might 
have repercussions in other parts of the code.) 
 
I hope that we can coordinate our respective updates for Lynx by 
agreeing on a release date. 
 
// Ulf Harnhammar for the Debian Security Audit Project 
   http://www.debian.org/security/audit/

------- Comment #2 From Sune Kloppenborg Jeppesen 2005-10-08 00:00:18 0000 -------
Created an attachment (id=70132) [edit]
lynx.security.patch

------- Comment #3 From Sune Kloppenborg Jeppesen 2005-10-08 22:16:02 0000 -------
New patch from Thomas Dickey <dickey@his.com> up at: 
   
ftp://invisible-island.net/temp/lynx2.8.6dev.13e-special.patch.gz  
  
Deedra, please attach an updated ebuild. Do NOT commit anything to portage.   
   
   

------- Comment #4 From Sune Kloppenborg Jeppesen 2005-10-11 14:05:21 0000 -------
Trying seemant instead. 

------- Comment #5 From Seemant Kulleen (RETIRED) 2005-10-11 14:15:39 0000 -------
I'll have something up for you guys shortly

------- Comment #6 From Seemant Kulleen (RETIRED) 2005-10-12 05:39:11 0000 -------
ok, so thomas' patch applies to the current development version of lynx
(2.8.6dev13).  I've asked him if he has a backport, else I'll be trying to
backport this myself to 2.8.5 (I'll probably need to bring Spanky or solar into
the picture to verify).

Thanks,

------- Comment #7 From Seemant Kulleen (RETIRED) 2005-10-12 06:35:01 0000 -------
Created an attachment (id=70451) [edit]
new ebuild for lynx

This is the new ebuild

------- Comment #8 From Seemant Kulleen (RETIRED) 2005-10-12 06:35:56 0000 -------
Created an attachment (id=70452) [edit]
Thomas Dickey's patch, back-ported to 2.8.5

This is the patch -- please place into ${FILESDIR} for testing purposes.  For
release, this will go onto mirrors.

------- Comment #9 From Sune Kloppenborg Jeppesen 2005-10-12 06:43:34 0000 -------
Thx Seemant.  
  
Calling arch security liaisons for testing:  
  
alpha  kloeri  
amd64  blubb  
hppa  hansmi  
ppc  hansmi  
ppc64  tgall  
sparc  gustavoz  
x86  tester  
  
Please test and report back on this bug. 

------- Comment #10 From Gustavo Zacarias (RETIRED) 2005-10-12 08:37:07 0000 -------
Looks sane for sparc.


------- Comment #11 From Simon Stelling (RETIRED) 2005-10-12 10:43:32 0000 -------
seems to work fine on amd64 too

------- Comment #12 From Michael Hanselmann (hansmi) (RETIRED) 2005-10-12 12:15:21 0000 -------
Looks good on ppc and hppa

------- Comment #13 From Sune Kloppenborg Jeppesen 2005-10-12 12:18:54 0000 -------
Status so far. Good on:  sparc, amd64, ppc and hppa 

------- Comment #14 From Thierry Carrez (RETIRED) 2005-10-14 01:33:40 0000 -------
Still missing alpha, ppc64 and x86 tests.
Adding rangerpb to handle ppc64.

------- Comment #15 From Brent Baude 2005-10-14 08:46:53 0000 -------
Looks good for ppc64

------- Comment #16 From Olivier Crete 2005-10-15 21:00:17 0000 -------
looks good on x86

------- Comment #17 From Bryan Østergaard (RETIRED) 2005-10-16 08:01:38 0000 -------
Alpha is good.

------- Comment #18 From Thierry Carrez (RETIRED) 2005-10-16 09:12:32 0000 -------
OK, all ready to be committed directly stable at disclosure date.
seemant: that should be sometime tomorrow.

------- Comment #19 From Sune Kloppenborg Jeppesen 2005-10-16 22:31:27 0000 -------
This is public now, please commit the updated ebuild. I'll open a new bug or 
remove restrictions on this one when I get up to date on my bug inbox later 
today. 

------- Comment #20 From Thierry Carrez (RETIRED) 2005-10-17 00:31:15 0000 -------
Opening.

------- Comment #21 From Seemant Kulleen (RETIRED) 2005-10-17 05:09:13 0000 -------
it's in portage now.

------- Comment #22 From Sune Kloppenborg Jeppesen 2005-10-17 08:10:06 0000 -------
Thx everyone. 
 
GLSA 200510-15  

First Last Prev Next    No search results available      Search page      Enter new bug