GHSA-x6w4-f264-3vvr

Suggest an improvement
Source
https://github.com/advisories/GHSA-x6w4-f264-3vvr
Import Source
https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-x6w4-f264-3vvr/GHSA-x6w4-f264-3vvr.json
JSON Data
https://api.osv.dev/v1/vulns/GHSA-x6w4-f264-3vvr
Aliases
Published
2026-11-20T14:35:29Z
Modified
2026-11-20T14:45:04Z
Severity
  • 7.1 (High) CVSS_V3 - CVSS:3.1/AV:N/AC:L/PR:N/UI:R/S:U/C:H/I:L/A:N CVSS Calculator
Summary
Refitter: Unrestricted OpenAPI references permit build-host SSRF and file inclusion
Details

Summary

Refitter (the refitter dotnet tool, built on NJsonSchema for $ref resolution) fetches remote http(s) URLs and reads local files (including absolute paths and ../ traversal outside the input directory), inlining the referenced schema into the generated Refit interface/contracts. Running refitter <spec> --output Out.cs on a spec whose $ref points at an attacker/internal URL or an arbitrary local file yields SSRF, remote file inclusion, and local file inclusion. Verified on Refitter 2.0.0.

Details

  • $ref: http://attacker-or-internal/evil.json#/... -> build host fetches (SSRF) and inlines the remote schema (RFI); confirmed property REMOTE_REFIT_PROP.
  • $ref: /abs/path.json#/... or ../../secret.json#/... -> out-of-tree local file read + inlined (LFI); confirmed property REFIT_LFI_MARKER. Both absolute and relative traversal work.

No RCE: Refitter emits Refit interfaces with no baseUrl string literal (Refit sets the base address at runtime), enum values use C# verbatim-string doubling, and string defaults are escaped. The chain stops at SSRF + RFI + LFI.

The $ref resolution is performed by Refitter's NJsonSchema dependency, which Refitter ships and invokes with these unsafe defaults.

PoC

reproduce.sh (+ make_spec.py, listener.py) attached: installs the .NET SDK + Refitter if needed, confirms LFI (out-of-tree read), SSRF (listener hit during generation), and RFI (remote schema inlined). Verified on 2.0.0.

Impact

Build-time SSRF (CWE-918) from the developer or CI host, disclosure of arbitrary local files (CWE-22), and inclusion of untrusted remote content (CWE-829), from running Refitter on an attacker-controlled or attacker-influenced OpenAPI description. No code execution. Estimated Medium-High, e.g. [reproduce.sh](https://github.com/user-attachments/files/29395269/reproduce.sh) (the CNA sets the final score).

Suggested fix

Don't resolve remote $refs by default (opt-in + host allowlist); confine local $ref resolution to the input directory tree (reject absolute paths and ../ escapes). Apply at all nesting levels. Coordinate with NJsonSchema, where the resolver lives. maintainer-report.txt advisory.md reproduce.sh maintainer-report.txt advisory.md listener.py make_spec.py

Database specific
{
    "cwe_ids": [
        "CWE-829",
        "CWE-918"
    ],
    "github_reviewed": true,
    "github_reviewed_at": "2026-11-20T14:35:29Z",
    "nvd_published_at": "2026-10-30T22:16:58Z",
    "severity": "HIGH"
}
References

Affected packages

NuGet / Refitter

Package

Name
Refitter
View open source insights on deps.dev
Purl
pkg:nuget/Refitter

Affected ranges

Type
ECOSYSTEM
Events
Introduced
0 Unknown introduced version / All previous versions are affected
Fixed
2.1.1

Affected versions

0.*
0.1.2-alpha
0.1.3-alpha
0.1.4-alpha
0.1.5-alpha
0.2.0-alpha
0.2.1-alpha
0.2.2-alpha
0.2.3-alpha
0.2.4-alpha
0.3.0
0.3.1
0.3.2
0.3.3
0.3.4
0.3.16
0.3.17
0.4.0
0.4.1
0.4.2
0.5.0
0.5.1
0.5.2
0.5.3
0.5.25
0.5.26
0.5.27
0.5.28
0.5.29
0.5.30
0.6.0
0.6.1
0.6.2
0.6.3
0.7.0
0.7.0.20-preview
0.7.0.21-preview
0.7.0.22-preview
0.7.0.23-preview
0.7.0.26-preview
0.7.0.27-preview
0.7.0.28-preview
0.7.1
0.7.1.29-preview
0.7.1.30-preview
0.7.1.31-preview
0.7.2
0.7.2.32-preview
0.7.3
0.7.3.33-preview
0.7.3.34-preview
0.7.3.35-preview
0.7.3.36-preview
0.7.3.37-preview
0.7.4
0.7.5
0.8.0
0.8.1
0.8.2
0.8.3
0.8.4
0.8.5
0.8.6
0.8.6.38-preview
0.8.6.39-preview
0.8.7
0.8.7.40-preview
0.8.7.41-preview
0.9.0
0.9.1
0.9.2
0.9.3.42-preview
0.9.4
0.9.4.43-preview
0.9.5
0.9.6
0.9.7
0.9.8
0.9.9
0.9.9.44-preview
1.*
1.0.0
1.0.1
1.0.2
1.1.0.45-preview
1.1.1
1.1.2
1.1.3
1.2.0
1.3.0
1.3.1
1.3.2
1.4.0
1.4.1
1.5.0
1.5.1
1.5.2
1.5.3
1.5.4
1.5.5
1.5.6
1.6.0
1.6.1
1.6.2
1.6.3
1.6.4
1.6.5
1.7.0
1.7.1
1.7.2
1.7.3
2.*
2.0.0
2.1.0

Database specific

source
"https://github.com/github/advisory-database/blob/main/advisories/github-reviewed/2026/11/GHSA-x6w4-f264-3vvr/GHSA-x6w4-f264-3vvr.json"