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

LuLu crashes for processes using non-UTF8 arguments #305

Closed
xnyhps opened this issue Jan 19, 2021 · 2 comments
Closed

LuLu crashes for processes using non-UTF8 arguments #305

xnyhps opened this issue Jan 19, 2021 · 2 comments

Comments

@xnyhps
Copy link

xnyhps commented Jan 19, 2021

Process arguments on macOS do not have a defined or enforced encoding. UTF8 is common, but nothing prevents a process from using something non-UTF8.

LuLu (and I suspect some other Objective-See tools too) assumes arguments are UTF8:

if(NULL != argStart)
{
//save
[self.arguments addObject:[NSString stringWithUTF8String:argStart]];
}

When a C string which is not valid UTF8 is used, -[NSString stringWithUTF8String:] returns nil. When attempting to add a nil object to an NSMutableArray, it throws an exception. This exception is not caught, which means the network extension crashes.

After the network extension crashes, internet access is unfiltered for a short time while it restarts. This makes it possible for malware to bypass LuLu by making it crash and then quickly accessing the network.

I recommend fixing this by either ignoring arguments that are invalid UTF8, or using NSData for storing arguments.

objective-see added a commit that referenced this issue Jan 19, 2021
improved process arg parsing (#305)
@objective-see
Copy link
Owner

Thanks! Good catch 😅
...just pushed a commit to fix the issue. Will make it into the next release!

objective-see added a commit that referenced this issue Jan 19, 2021
improved process arg parsing (#305)
@objective-see
Copy link
Owner

fixed release v2.3.0

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