-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Description
#2501 # Description
I have encountered multiple android applications that crash and sometimes become unusable (Denial of Service) for the user, when the application accepts markdown. to trigger this exploit a malicious user would send command  to a user in a chat. When the message gets rendered on the users phone the application cashes for and sometimes continues to crash until the exploit is removed. In some applications that allows chats, the chat might open after reopening the application cause a Denial of Service on the valid user. Sometimes it is not possible to remove the malicious markdown. I believe the code south be validated and check for a null value and caught if found.
Reproduction
on line 393 of ImageRequest.java there is a missing null check. By utilizing the below code, the application crashes with the below error.
Uncaught Error: Attempt to invoke virtual method
'int java.lang.String.lastIndexOf(int)' on a null object referenceTherefore if an application passes user-supplied data to the getSize() method an error will be thrown.
import React from 'react';
const imageSize = Image.getSize('file:',_=>{} );The getSize method is not the only part affected. If any React Native call that invokes com.facebook.impagepipeline.request ImageRequest
Solution
Implement a null check here
Additional Information
- Fresco version: 2.3.0
- Lastest commit: bd50311
- Platform version: React Native 0.63