Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Heap-buffer-overflow READ in Assimp::MD5::MD5MeshParser::MD5MeshParser #5110

Merged
merged 2 commits into from Jun 8, 2023

Conversation

sashashura
Copy link
Contributor

@sashashura sashashura commented May 31, 2023

Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=54435
Closes #4922

The buffer read overflow happens because the string szStart used in AI_MD5_PARSE_STRING_IN_QUOTATION doesn't contain double quotes. In this reproducer case for exampel it is \U00000013\U00000013\U00000013\xecΐ\xec\xec\xec\xec\xec\xec\xec\xec\xec\xec\xec\0.
However it is guaranteed to be zero terminated:

	elem.szStart = buffer;

	// terminate the line with zero
	while (!IsLineEnd(*buffer))
		++buffer;
	if (*buffer) {
		++lineNumber;
		*buffer++ = '\0';
	}

Copy link
Member

@kimkulling kimkulling left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine, thanks for the fix.

@kimkulling kimkulling merged commit 9950bb4 into assimp:master Jun 8, 2023
11 checks passed
@kimkulling
Copy link
Member

Merged, thanks a lot for your contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
2 participants