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

Buffer Overflow Can Occur For Valid CHDs (and malicious CHDs) #118

Open
CasualPokePlayer opened this issue May 3, 2024 · 2 comments
Open

Comments

@CasualPokePlayer
Copy link

libchdr currently makes an assumption that any compressed hunk can fit within an uncompressed hunk. This assumption can be wrong however for completely valid CHDs, if they were created with low compression levels (as implicitly some internal compression header/footer could be present along with the possibly not very compressed data). It can also be trivially wrong for any maliciously created CHD, since the compressed hunk length is just something read from the hunk map.

@rtissera
Copy link
Owner

rtissera commented May 3, 2024

Can you pinpoint the (single or multiple) code vulnerabilities in source tree ?

@CasualPokePlayer
Copy link
Author

bytes = core_fread(chd->file, chd->compressed, size);

size is not bounds checked, chd->compressed should be reallocated accordingly if size exceeds the buffer size.

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

No branches or pull requests

2 participants