RSDKModding / RSDKv3-Decompilation

A Full Decompilation of Sonic CD (2011) & Retro Engine (v3)
Other
591 stars 120 forks source link

fcaseopen.c buffer overflow #232

Closed minerscale closed 8 months ago

minerscale commented 8 months ago

Expected Behavior

memory is not supposed to get corrupted by the library that opens files case-insensitively

Actual Behavior

memory gets corrupted by the library that opens files case-insensitively

Steps to Reproduce

Hi!

Whilst trying to open a file case-insensitively I came across a codebase that seemed to do the job. But clang's address sanitizer was having none of it! It turns out that there is an off by one error in the buffer size allocation of fcaseopen causing a null terminator to be strcpy'd into unmanaged memory. I reported the problem to the original project but I decided I'd also let everyone I could find who still had the vulnerability floating around copies of it know as well.

You can find more information about it here: https://github.com/OneSadCookie/fcaseopen/issues/2

Thanks, Aaron.

Screenshots

No response

Log File

No response

Decompilation Version

all of them

Game Version

Blit Release (Steam/XBOX 360/PS3)

Game Revision

No response

Script Platform Type

Standard

Renderer Type

Software Renderer

Platform

N/A

Additional Comments

No response