Issue 160 in shellinabox: Missing null termination in httpGetURL, urlGetURL

0 views
Skip to first unread message

shell...@googlecode.com

unread,
Jan 12, 2012, 12:16:03 AM1/12/12
to shell...@googlegroups.com
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 160 by anders.kaseorg: Missing null termination in httpGetURL,
urlGetURL
http://code.google.com/p/shellinabox/issues/detail?id=160

The strncat() calls in httpGetURL and urlGetURL do not ensure that long
strings are null terminated. This patch corrects that by using calloc
instead of malloc.

(This probably isn’t currently exploitable because :port can’t be 25
characters long, but should be fixed anyway.)

Attachments:
0001-httpGetURL-urlGetURL-Ensure-null-termination.patch 2.5 KB

shell...@googlecode.com

unread,
Jan 18, 2012, 12:47:17 AM1/18/12
to shell...@googlegroups.com

Comment #1 on issue 160 by Jayschwa: Missing null termination in
httpGetURL, urlGetURL
http://code.google.com/p/shellinabox/issues/detail?id=160

strncat() always appends a null byte according to:
http://pubs.opengroup.org/onlinepubs/009604599/functions/strncat.html

I am unsure why this change is necessary. Can you clarify?

shell...@googlecode.com

unread,
Jan 18, 2012, 12:51:18 AM1/18/12
to shell...@googlegroups.com

Comment #2 on issue 160 by anders.kaseorg: Missing null termination in
httpGetURL, urlGetURL
http://code.google.com/p/shellinabox/issues/detail?id=160

Yeah, you’re right, you can ignore this patch.

shell...@googlecode.com

unread,
Jan 18, 2012, 12:57:20 AM1/18/12
to shell...@googlegroups.com

Comment #3 on issue 160 by Jayschwa: Missing null termination in
httpGetURL, urlGetURL
http://code.google.com/p/shellinabox/issues/detail?id=160

How about the size parameter? Is there a potential for overflow, as was the
case in your #159?

Reply all
Reply to author
Forward
0 new messages