Skip to content

Commit 68b52a7

Browse files
authored
Explicitly block photos from LBPMod.me (#907)
This website allows direct uploading of custom stickers. Since the website announces itself we can just go ahead and block it for now, since I'm seeing suspicious behavior relating to this. Config toggles for this can be made for other instances on request. I'm tired, boss.
2 parents d541d6f + d375305 commit 68b52a7

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Refresh.Interfaces.Game/Endpoints/PhotoEndpoints.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ public Response UploadPhoto(RequestContext context, SerializedPhoto body, GameDa
4343
return BadRequest;
4444
}
4545

46+
if (body.PhotoSubjects.Any(s => s.Username.Equals("LBPMod.me", StringComparison.InvariantCultureIgnoreCase)))
47+
{
48+
context.Logger.LogWarning(BunkumCategory.UserContent, $"Photo contains disallowed subjects, rejecting photo upload. Uploader: {user.UserId}");
49+
return Unauthorized;
50+
}
51+
4652
List<string> hashes = [body.LargeHash, body.MediumHash, body.SmallHash];
4753
foreach (string hash in hashes.Distinct())
4854
{

0 commit comments

Comments
 (0)