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

v0.17.4.1 - Add user atomic lock #164

Merged
merged 8 commits into from
May 10, 2024
Merged

v0.17.4.1 - Add user atomic lock #164

merged 8 commits into from
May 10, 2024

Conversation

SakuraIsayeki
Copy link
Owner

Adds a lock system to mitigate GHSA-v6cc-v976-mj8g.
Each action submitted to this lock will be concurrently rate-limited per indvidual user, allowing only one request at a time, per action, per user.

Thank you @BloodyTakao for responsibly disclosing the above vulnerability.

- Updated Microsoft.IdentityModel.JsonWebTokens to version 7.5.0 in WowsKarma.Api.Minimap.Client.csproj
- Updated Hangfire.AspNetCore to version 1.8.12 and Hangfire.PostgreSql to version 1.20.8 in WowsKarma.Api.csproj
- Updated Microsoft.AspNetCore.Authentication.JwtBearer, Microsoft.AspNetCore.SignalR.Protocols.MessagePack, and Microsoft.AspNetCore.SignalR.Protocols.NewtonsoftJson to version 8.0.4 in WowsKarma.Api.csproj
- Updated Microsoft.EntityFrameworkCore.Design to version 8.0.4 in WowsKarma.Api.csproj
- Updated NodaTime to version 3.1.11 and Nodsoft.WowsReplaysUnpack.ExtendedData to version 2.0.4 in WowsKarma.Api.csproj
- Updated Polly.Extensions to version 8.3.1 in WowsKarma.Api.csproj
The WgAuthCallback URLs in the appsettings.Development.json file have been updated to use HTTPS instead of HTTP.
This commit adds the `UserAtomicLock` attribute and middleware to the API. The `UserAtomicLock` attribute is used to lock concurrency on a given action to a specific user. The `UserAtomicLockMiddleware` provides the functionality to lock a given action to a specific user. This ensures that only one request from the same user can access the locked action at a time, preventing unwanted concurrent modifications.
- Added `UserAtomicLock` attribute to the `CreatePost` action in `PostController.cs`
- Registered `UserAtomicLockMiddleware` as a singleton in `Startup.cs`
- Added `app.UseMiddleware<UserAtomicLockMiddleware>()` in the HTTP request pipeline
@SakuraIsayeki SakuraIsayeki self-assigned this May 10, 2024
The project version in the WowsKarma.Api.csproj file has been updated from 0.17.4 to 0.17.4.1, reflecting a minor revision change for the API project.
@SakuraIsayeki SakuraIsayeki merged commit 6f43217 into main May 10, 2024
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Development

Successfully merging this pull request may close these issues.

1 participant