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

[Base64] Crashes when trying to decode an Incomplete/Incorrect Base64 Message #42

Open
RedrcknRbn opened this issue Sep 6, 2023 · 0 comments

Comments

@RedrcknRbn
Copy link

When attempting to decode an incomplete/broken Base64 message, the entire client crashes.
Logs:

java.lang.IllegalArgumentException: bad base-64
	at android.util.Base64.decode(Base64.java:163)
	at android.util.Base64.decode(Base64.java:138)
	at android.util.Base64.decode(Base64.java:120)
	at com.aliucord.plugins.Base64.lambda$start$1(Base64.java:54)
	at com.aliucord.plugins.Base64$$ExternalSyntheticLambda0.onClick(Unknown Source:4)
	at android.view.View.performClick(View.java:7892)
	at android.widget.TextView.performClick(TextView.java:16219)
	at android.view.View.performClickInternal(View.java:7869)
	at android.view.View.-$$Nest$mperformClickInternal(Unknown Source:0)
	at android.view.View$PerformClick.run(View.java:30880)
	at android.os.Handler.handleCallback(Handler.java:942)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loopOnce(Looper.java:226)
	at android.os.Looper.loop(Looper.java:313)
	at android.app.ActivityThread.main(ActivityThread.java:8757)
	at java.lang.reflect.Method.invoke(Native Method)
	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:571)
	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1067)

How to reproduce:
I have an incorrect Base64 Script here that upon decode attempt, the client crashes:
g SWYgdGhleSBkaWRuJ3QgZ2l2ZSB5b3UgcGVybWlzc2lvbiB0byBwb3N0IGl0LCBpdCB1c3VhbGx5 IGZhbGxzIHVuZGVyIHRoaXMgcnVsZQojIyBSdWxlIDQ6IE5vIEJ5cGFzc2VzIC0gRGVwZW5kcyBv biB0aGUgcnVsZQojIyMgQW55IGF0dGVtcHQgdG8gYnlwYXNzIGEgcnVsZSBsaXN0ZWQgaGVyZSBp

The plugin should be able to check if the message can actually be converted into Base64, and if it doesn't, fallback to an error message instead of crashing.

@RedrcknRbn RedrcknRbn changed the title Crashes when trying to decode an Incomplete/Incorrect Base64 Message [Base64] Crashes when trying to decode an Incomplete/Incorrect Base64 Message Sep 6, 2023
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

1 participant