-
Notifications
You must be signed in to change notification settings - Fork 6
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
Glide library detection rule #715
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
// ruleid: glide-library | ||
import com.bumptech.glide.load.DataSource; | ||
|
||
if (mBraveNewsController != null) { | ||
mBraveNewsController.getImageData(adImageUrl, imageData -> { | ||
if (imageData != null) { | ||
Bitmap decodedByte = | ||
BitmapFactory.decodeByteArray(imageData, 0, imageData.length); | ||
// ruleid: glide-library | ||
Glide.with(mActivity) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. reported by reviewdog 🐶 |
||
.asBitmap() | ||
.load(decodedByte) | ||
.fitCenter() | ||
.priority(Priority.IMMEDIATE) | ||
.diskCacheStrategy(DiskCacheStrategy.ALL) | ||
.into(new CustomTarget<Bitmap>() { | ||
@Override | ||
public void onResourceReady(@NonNull Bitmap resource, | ||
@Nullable Transition<? super Bitmap> transition) { | ||
imageView.setImageBitmap(resource); | ||
} | ||
@Override | ||
public void onLoadCleared(@Nullable Drawable placeholder) {} | ||
}); | ||
imageView.setClipToOutline(true); | ||
} | ||
}); | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
rules: | ||
- id: glide-library | ||
metadata: | ||
author: Artem Chaikin | ||
references: | ||
- https://github.com/brave/reviews/issues/1391 | ||
source: https://github.com/brave/security-action/blob/main/assets/semgrep_rules/client/glide-library.yaml | ||
assignees: | | ||
stoletheminerals | ||
bridiver | ||
message: "The Glide image loading library is not yet approved, new usages should not be implemented until the security team has given their approval." | ||
languages: [java] | ||
severity: WARNING | ||
patterns: | ||
- pattern-either: | ||
- pattern: "import com.bumptech.glide" | ||
- pattern: "Glide.with(...)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reported by reviewdog 🐶
[semgrep] The Glide image loading library is not yet approved, new usages should not be implemented until the security team has given their approval.
Source: https://github.com/brave/security-action/blob/main/assets/semgrep_rules/client/glide-library.yaml
Cc @stoletheminerals @bridiver