New issue
Advanced search Search tips

Issue 598694 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Apr 2016
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: ----
Type: Bug-Security



Sign in to add a comment

Security: Chrome OS buffer overflow syren.c

Reported by eternalg...@gmail.com, Mar 29 2016

Issue description

VULNERABILITY DETAILS
Buffer Overflow [CWE-120]

VERSION
ChromeOs Version: Current Stable
Operating System: Chromeos

REPRODUCTION CASE
A buffer overflow condition exists when a program attempts to put more data in a buffer than it can hold or when a program attempts to put data in a memory area past a buffer. In this case, a buffer is a sequential section of memory allocated to contain anything from a character string to an array of integers. Writing outside the bounds of a block of allocated memory can corrupt data, crash the program, or cause the execution of malicious code. 

VULNERABLE CODE
https://android.googlesource.com/platform/system/core/+/froyo/toolbox/syren.c#126

	r = find_reg(argv[2]);
	if (r == NULL) {
		strcpy(name, argv[2]);
		char *addr_str = strchr(argv[2], ':');
		if (addr_str == NULL)
			return usage();
		*addr_str++ = 0;
		sio.page = strtoul(argv[2], 0, 0);
		sio.addr = strtoul(addr_str, 0, 0);
	} else {
		strcpy(name, r->name);
		sio.page = r->page;
		sio.addr = r->addr;
	}

If r returns null and argv[2] is bigger then char name[32] a buffer overflow will occur. Strcpy does not check the size before copying it into name. You're better off using strncpy since that requires you to put a lenght in it.

Kind Regards,

Jordy Zomer
 
Labels: Needs-Feedback
Could you please provide a test case that exercises this in an actual Chrome OS build? Static analysis reports are often false-positives, or may not be reachable through normal execution.
I don't have a chromebook, would it be a viable thing to do on a virtual machine? :)
Project Member

Comment 3 by sheriffbot@chromium.org, Mar 30 2016

Labels: -Needs-Feedback Needs-Review
Owner: mbarbe...@chromium.org
Thank you for providing more feedback. Adding requester "mbarbella@chromium.org" for another review and adding "Needs-Review" label for tracking.

For more details visit https://sites.google.com/a/chromium.org/dev/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: -Needs-Review
Owner: ----
https://www.chromium.org/chromium-os/how-tos-and-troubleshooting/running-chromeos-image-under-virtual-machines seems to have documentation for doing this, though I'm not sure how recent it is.
Thank you, I'll look into it soon.
Labels: Needs-Feedback OS-Chrome

Comment 7 by kenrb@chromium.org, Apr 7 2016

Closing for now. This can be re-opened or you can file a new bug if this bug is reachable by a proof of concept.

Comment 8 by kenrb@chromium.org, Apr 7 2016

Status: WontFix (was: Unconfirmed)
Project Member

Comment 9 by sheriffbot@chromium.org, Jul 15 2016

Labels: -Restrict-View-SecurityTeam
This bug has been closed for more than 14 weeks. Removing security view restrictions.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member

Comment 10 by sheriffbot@chromium.org, Oct 1 2016

This bug has been closed for more than 14 weeks. Removing security view restrictions.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member

Comment 11 by sheriffbot@chromium.org, Oct 2 2016

This bug has been closed for more than 14 weeks. Removing security view restrictions.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Labels: allpublic

Sign in to add a comment