Skip to content

fix: pin Microsoft.OpenApi to 2.7.5 to avoid CVE-2026-49451#1543

Merged
Aaronontheweb merged 1 commit into
devfrom
fix/microsoft-openapi-vulnerability
Jul 1, 2026
Merged

fix: pin Microsoft.OpenApi to 2.7.5 to avoid CVE-2026-49451#1543
Aaronontheweb merged 1 commit into
devfrom
fix/microsoft-openapi-vulnerability

Conversation

@Aaronontheweb

Copy link
Copy Markdown
Collaborator

Problem

The linux-x64 publish job was failing during restore with:

error NU1903: Package 'Microsoft.OpenApi' 2.0.0 has a known high severity vulnerability, https://github.com/advisories/GHSA-v5pm-xwqc-g5wc

Microsoft.OpenApi 2.0.0 is pulled in transitively by Microsoft.AspNetCore.OpenApi 10.0.9. The vulnerable version is affected by CVE-2026-49451 — a stack overflow (DoS) when parsing OpenAPI documents with circular schema references.

Fix

Add a central package version pin for Microsoft.OpenApi at 2.7.5 (the first patched version in the 2.x line). Since CentralPackageTransitivePinningEnabled is already true in Directory.Packages.props, this forces the transitive dependency to the safe version without changing any direct references.

Testing

CI should pass — this is a pure dependency pin with no code changes.

CentralPackageTransitivePinningEnabled is true, so adding a
PackageVersion entry for Microsoft.OpenApi forces the transitive
dependency from Microsoft.AspNetCore.OpenApi to use the patched
version (2.7.5) instead of the vulnerable 2.0.0.
@Aaronontheweb
Aaronontheweb merged commit 464616f into dev Jul 1, 2026
21 checks passed
@Aaronontheweb
Aaronontheweb deleted the fix/microsoft-openapi-vulnerability branch July 1, 2026 15:46
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

Successfully merging this pull request may close these issues.

1 participant