mailing list of musl libc
 help / color / mirror / code / Atom feed
* Re: Security advisory for musl libc - stack-based buffer overflow in ipv6 literal parsing [CVE-2015-1817]
@ 2015-04-17 13:10 Matt Johnston
  2015-04-17 17:23 ` Rich Felker
  0 siblings, 1 reply; 28+ messages in thread
From: Matt Johnston @ 2015-04-17 13:10 UTC (permalink / raw)
  To: musl

Hi,

I think Dropbear probably is vulnerable to CVE-2015-1817
post-authentication. TCP forwarding requests will call
getaddrinfo() 
https://secure.ucc.asn.au/hg/dropbear/file/cbd674d63cd4/dbutil.c#l415
(moved to netio.c in head, and PF_UNSPEC has been fixed to
AF_UNSPEC). Pre-authentication should be OK, only
getnameinfo() is called (if that's enabled).

musl's network-facing DNS code seems a bit precarious with
pointer arithmetic?

Please CC replies, I'm not subscribed.

Cheers,
Matt



^ permalink raw reply	[flat|nested] 28+ messages in thread
* Security advisory for musl libc - stack-based buffer overflow in ipv6 literal parsing [CVE-2015-1817]
@ 2015-03-30  4:01 Rich Felker
  2015-03-30  4:33 ` Рысь
  0 siblings, 1 reply; 28+ messages in thread
From: Rich Felker @ 2015-03-30  4:01 UTC (permalink / raw)
  To: musl, oss-security

[-- Attachment #1: Type: text/plain, Size: 720 bytes --]

A stack-based buffer overflow has been found in musl libc's ipv6
address literal parsing code. Programs which call the inet_pton or
getaddrinfo function with AF_INET6 or AF_UNSPEC and untrusted address
strings are affected. Successful exploitation yields control of the
return address. Having enabled stack protector at the application
level does not mitigate the issue. All users should patch or upgrade.

Software: musl libc (http://www.musl-libc.org)

Severity: high

Affected Versions: 0.9.15 - 1.0.4, 1.1.0 - 1.1.7.

Bug introduced in commit: 78f889153167452de4cbced921f6428b3d4f663a

Bug fixed in commit: fc13acc3dcb5b1f215c007f583a63551f6a71363

Patch: musl_dn_expand_overflow_fix.diff (attached) (fix+hardening)

[-- Attachment #2: musl_inet_pton_overflow_fix.diff --]
[-- Type: text/plain, Size: 591 bytes --]

diff --git a/src/network/inet_pton.c b/src/network/inet_pton.c
index 4496b47..d36c368 100644
--- a/src/network/inet_pton.c
+++ b/src/network/inet_pton.c
@@ -39,14 +39,15 @@ int inet_pton(int af, const char *restrict s, void *restrict a0)
 	for (i=0; ; i++) {
 		if (s[0]==':' && brk<0) {
 			brk=i;
-			ip[i]=0;
+			ip[i&7]=0;
 			if (!*++s) break;
+			if (i==7) return 0;
 			continue;
 		}
 		for (v=j=0; j<4 && (d=hexval(s[j]))>=0; j++)
 			v=16*v+d;
 		if (j==0) return 0;
-		ip[i] = v;
+		ip[i&7] = v;
 		if (!s[j] && (brk>=0 || i==7)) break;
 		if (i==7) return 0;
 		if (s[j]!=':') {

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2015-04-20 14:21 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-04-17 13:10 Security advisory for musl libc - stack-based buffer overflow in ipv6 literal parsing [CVE-2015-1817] Matt Johnston
2015-04-17 17:23 ` Rich Felker
2015-04-17 18:03   ` Rich Felker
2015-04-17 18:09     ` Solar Designer
2015-04-18 13:32       ` Matt Johnston
2015-04-18 15:25         ` Rich Felker
2015-04-18 15:49           ` Harald Becker
2015-04-18 15:58             ` Rich Felker
2015-04-18 16:27               ` Harald Becker
2015-04-18 16:37                 ` Rich Felker
2015-04-18 17:07                   ` Harald Becker
2015-04-18 18:27                     ` Laurent Bercot
2015-04-18 18:47                       ` Harald Becker
2015-04-18 18:13                   ` Harald Becker
2015-04-18 19:56                     ` Rich Felker
2015-04-18 21:02                       ` Laurent Bercot
2015-04-19  3:44                         ` Rich Felker
2015-04-20 10:17                           ` Harald Becker
2015-04-20 11:20                             ` Kurt H Maier
2015-04-20 11:35                               ` Harald Becker
2015-04-20 11:50                                 ` Harald Becker
2015-04-20 14:14                                 ` Kurt H Maier
2015-04-20 14:21                                   ` Harald Becker
2015-04-18 18:25                   ` Harald Becker
  -- strict thread matches above, loose matches on Subject: below --
2015-03-30  4:01 Rich Felker
2015-03-30  4:33 ` Рысь
2015-03-30  4:41   ` Rich Felker
2015-03-30  5:18     ` Рысь

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).