Fix high-severity Snyk findings by pinning vulnerable transitive packages - #64
Open
devin-ai-integration[bot] wants to merge 2 commits into
Open
devin-ai-integration[bot] wants to merge 2 commits into
devin-ai-integration[bot] wants to merge 2 commits into
Conversation
…ages Co-Authored-By: shayan <shayan@cognition.ai>
Author
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Co-Authored-By: shayan <shayan@cognition.ai>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Resolves all Snyk findings from
snyk test --all-projectsby bumpingNpgsqland adding explicitPackageReferencepins for packages that were only present transitively..csprojchanges:src/Infrastructure:Npgsql7.0.4 → 7.0.7 (CVE-2024-32655, SQL injection); pinAzure.Identity1.13.2 (CVE-2023-36414 RCE + two medium findings still open in 1.10.2),Microsoft.Data.SqlClient5.1.3 (CVE-2024-0056, unprotected credential storage),System.Text.Json8.0.5 (CVE-2024-30105 DoS),System.Formats.Asn18.0.1,Microsoft.IdentityModel.JsonWebTokens/System.IdentityModel.Tokens.Jwt6.35.0src/WebApi: pinNpgsql7.0.7 andSystem.Text.Json8.0.5tests/Application.Tests,tests/WebApi.Tests: pinSystem.Net.Http4.3.4 (CVE-2017-0247/0248/0249, CVE-2018-8292) andSystem.Text.RegularExpressions4.3.1 (CVE-2019-0820 ReDoS) — both pulled in viaFakeItEasy > Castle.Core > NETStandard.LibraryTwo deviations from the reported fix versions, both deliberate:
System.Text.Jsonis pinned to 8.0.5, not 8.0.4: after upgrading to 8.0.4 Snyk reported a new high finding (SNYK-DOTNET-SYSTEMTEXTJSON-8168848, inefficient algorithmic complexity) fixed in 8.0.5.System.Drawing.Commonis not pinned to 5.0.3.Microsoft.Data.SqlClient5.1.3 already brings inSystem.Drawing.Common6.0.0 transitively (viaSystem.Configuration.ConfigurationManager→System.Security.Permissions→System.Windows.Extensions), which is above the vulnerable range; pinning 5.0.3 caused anNU1605package-downgrade build error. Snyk confirms the finding is gone.The last four pins (
System.Formats.Asn1, the two IdentityModel packages, and theAzure.Identity1.10.2 → 1.13.2 bump) address medium/low findings that the Snyk PR gate flagged after the initial high-severity fix, and are all pulled in transitively byMicrosoft.Data.SqlClient/Azure.Identity.Before / after (
snyk test --all-projects):dotnet buildsucceeds (0 errors) anddotnet testpasses (6 Application + 14 WebApi tests). No source code or tests were modified.Deliberately not fixed — recommended follow-up
The
Dockerfileruntime base imagemcr.microsoft.com/dotnet/aspnet:7.0is out of Microsoft support and Snyk reports 14 critical and 96 high OS-level vulnerabilities against it. Fixing this requires movingTargetFrameworkfromnet7.0to a supported LTS (net8.0) across all six projects plus the SDK build stage, which is a larger change with its own compatibility risk (EF Core / Npgsql / HotChocolate major bumps). It should be done in a dedicated PR.Link to Devin session: https://app.devin.ai/sessions/660d66a3e0c145b6a0f863dc25b54ba3
Requested by: @shayanshafii
Devin Review