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

Binary Makes Use of Malloc Function Security vulnerability issue #14209

Open
nkvgopinath opened this issue Dec 4, 2024 · 3 comments
Open

Binary Makes Use of Malloc Function Security vulnerability issue #14209

nkvgopinath opened this issue Dec 4, 2024 · 3 comments
Labels
sessions Changes pertaining to the Firebase Sessions SDK

Comments

@nkvgopinath
Copy link

Description

In C and C++, memory is typically allocated in two ways: statically and dynamically. Static allocation is done
at compile time, and the memory is allocated for the entire duration of the program's execution. Dynamic
allocation, on the other hand, is done at runtime using the malloc function, which allocates memory on the
heap.
If a binary makes use of malloc, there is a risk of memory leaks and buffer overflows. Memory leaks occur
when memory is allocated but not properly freed, leading to a gradual loss of available memory. Buffer
overflows occur when more data is written to a buffer than the buffer can hold, potentially overwriting
adjacent memory.

Thanks and Regards
MBRHE TEAM

Reproducing the issue

Screenshot 2024-12-04 at 1 16 41 PM

Firebase SDK Version

11.4.2

Xcode Version

16.1

Installation Method

CocoaPods

Firebase Product(s)

Analytics, Crashlytics, Firestore

Targeted Platforms

iOS

Relevant Log Output

Our security research team suggested using calloc instead of malloc to ensure safe memory initialization and to prevent memory overflow vulnerabilities."

This version clarifies the intent and highlights the security advantage of calloc, which initializes memory to zero, unlike malloc

If using Swift Package Manager, the project's Package.resolved

No response

If using CocoaPods, the project's Podfile.lock

pod 'Firebase/Messaging'
pod 'Firebase/Analytics'
pod 'Firebase/Crashlytics'

@google-oss-bot
Copy link

I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.

@themiswang
Copy link
Contributor

I have changed Crashlytics side, gonna remove Crashlytics label and add Analytics and Messaging.

@paulb777
Copy link
Member

Thanks @themiswang git grep shows no malloc calls in messaging, but two in Sessions as well as several error messages in Crashlytics.

@paulb777 paulb777 added sessions Changes pertaining to the Firebase Sessions SDK and removed api: messaging api: analytics labels Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sessions Changes pertaining to the Firebase Sessions SDK
Projects
None yet
Development

No branches or pull requests

5 participants