chore(deps): update dependency refit to v8 [security] #1912
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.
This PR contains the following updates:
7.2.1
->8.0.0
GitHub Vulnerability Alerts
CVE-2024-51501
Summary
The various header-related Refit attributes (Header, HeaderCollection and Authorize) are vulnerable to CRLF injection.
Details
The way HTTP headers are added to a request is via the
HttpHeaders.TryAddWithoutValidation
method:refit/Refit/RequestBuilderImplementation.cs
Line 1328 in 258a771
This method does not check for CRLF characters in the header value.
This means that any headers added to a refit request are vulnerable to CRLF-injection. In general, CRLF-injection into a HTTP header (when using HTTP/1.1) means that one can inject additional HTTP headers or smuggle whole HTTP requests.
PoC
The below example code creates a console app that takes one command line variable (a bearer token) and then makes a request to some status page with the provided token inserted in the "Authorization" header:
This application is now vulnerable to CRLF-injection, and can thus be abused to for example perform request splitting and thus server side request forgery (SSRF):
The application intends to send a single request of the form:
But as the application is vulnerable to CRLF injection the above command will instead result in the following two requests being sent:
and
This can be confirmed by checking the access logs on the server where these commands were run (with
insert.some.site.here
pointing to localhost):Impact
If an application using the Refit library passes a user-controllable value through to a header, then that application becomes vulnerable to CRLF-injection. This is not necessarily a security issue for a command line application like the one above, but if such code were present in a web application then it becomes vulnerable to request splitting (as shown in the PoC) and thus Server Side Request Forgery.
Strictly speaking this is a potential vulnerability in applications using Refit, not in Refit itself, but I would argue that at the very least there needs to be a warning about this behaviour in the Refit documentation.
Release Notes
reactiveui/refit (Refit)
v8.0.0
Compare Source
Features
ebc7954
feat: add parameter substitution tests (#1896) @ChrisPulman @TimothyMakkison0ba7394
feat: addUniqueNameBuilder
(#1894) @TimothyMakkisonc1d7aa1
feat: add more incremental tests (#1871) @TimothyMakkison606a6c6
feat: added nullable and parameter tests (#1863) @ChrisPulman @TimothyMakkisonfaa1f68
feat: added source gen tests for generic constraints (#1859) @TimothyMakkison7e53d81
feat: fix invalidunmanaged struct
constraint generation (#1861) @ChrisPulman @TimothyMakkison93b4ee2
feat: add non refit method raises diagnostic test (#1860) @ChrisPulman @TimothyMakkisond03121d
feat: addIDisposable
test (#1855) @TimothyMakkison6de1dbb
feat: changeIPerformanceService
to returnHttpResponseMessage
(#1893) @TimothyMakkison27b436c
feat: added larger benchmark (#1848) @ChrisPulman @TimothyMakkison7ea950a
feat: addReflectionTests
forIUrlParameterFormatter
(#1888) @TimothyMakkisona831dac
feat: addShouldNotEmitFiles
test (#1843) @TimothyMakkison56d7bcd
feat: generate code for derived non refit methods and update tests. (#1875) @TimothyMakkisonf2ab216
feat: add incremental generator tests (#1829) @ChrisPulman @TimothyMakkisona01cb84
feat: addRestServiceExceptions
(#1886) @TimothyMakkison396c2bf
feat: added default interface method tests (#1881) @TimothyMakkisonc72fa3a
feat: upgrade roslyn 4.0 to 4.1 (#1828) @ChrisPulman @TimothyMakkisonb32c305
feat: added derived type argument tests (#1883) @TimothyMakkison26cfb28
feat: add incremental generator (#1864) @TimothyMakkisonRefactoring
1869ca6
refactor: move diagnostics to dedicated class (#1842) @ChrisPulman @TimothyMakkisonFixes
84d226f
Fix for unused reference System.Net.Http (#1830) @ChrisPulman040ecc6
Fix some typos in the codebase (#1852) @ChrisPulman @mithileshz483b1d8
Fix for CRLF injection vulnerability (#1834) @ChrisPulmanGeneral Changes
057ba9e
Housekeeping fix some of the code analyser warnings (#1869) @ChrisPulmanb6f8eeb
chore: added generic constrained method tests (#1868) @TimothyMakkisonf7f9c00
Housekeeping fix some of the code analyser warnings (#1866) @ChrisPulman418092e
Housekeeping Update Version for release @ChrisPulman9b19657
Housekeeping Fix API Tests (#1865) @ChrisPulman2c2e596
Housekeeping Update build (#1835) @ChrisPulman30664b6
chore: update toMicrosoft.CodeAnalysis.CSharp
to4.1.0
(#1857) @ChrisPulman @TimothyMakkison6cb59cf
chore: target correct StubGenerator (#1847) @ChrisPulman @TimothyMakkison2978e37
Update release.yml (#1839) @ChrisPulman5df30d9
chore: upgradeVerify.SourceGenerators
and update tests (#1874) @ChrisPulman @TimothyMakkisonDependencies
8861dec
chore(deps): update dependency microsoft.codeanalysis.csharp.workspaces to 4.12.0-3.24476.2 (#1849) @renovate[bot]2d2169c
chore(deps): update dependency verify.xunit to v27 (#1890) @ChrisPulman @renovate[bot]440e236
chore(deps): update dependency xunit to 2.9.1 (#1858) @renovate[bot]1183b0d
chore(deps): update dependency verify.xunit to 26.4.2 (#1827) @renovate[bot]8b915fa
chore(deps): update dependency verify.xunit to 26.6.0 (#1854) @renovate[bot]58992b0
chore(deps): update dotnet monorepo (#1836) @renovate[bot]ef9b830
chore(deps): update dependency system.text.json to 8.0.5 [security] (#1873) @renovate[bot]48d1256
chore(deps): update dependency xunit to 2.9.2 (#1870) @renovate[bot]9619841
chore(deps): update dependency nerdbank.gitversioning to 3.6.146 (#1895) @renovate[bot]10bd63a
chore(deps): update dependency serilog to 4.0.2 (#1872) @renovate[bot]f7feafc
chore(deps): update dependency verify.diffplex to 3.1.2 (#1887) @renovate[bot]9c4dbc3
chore(deps): update dependency verify.sourcegenerators to 2.4.2 (#1833) @renovate[bot]704ee4c
chore(deps): update dependency microsoft.codeanalysis.csharp.workspaces to 4.12.0-3.24463.9 (#1838) @renovate[bot]2b8fca6
chore(deps): update dependency microsoft.codeanalysis.csharp.workspaces to 4.12.0-3.24466.4 (#1845) @ChrisPulman @renovate[bot]fd0dd65
chore(deps): update dependency verify.xunit to 26.4.5 (#1841) @renovate[bot]b8bb6cf
chore(deps): update dependency verify.sourcegenerators to 2.4.3 (#1840) @renovate[bot]ecb325d
chore(deps): update dependency verify.xunit to 26.4.4 (#1831) @renovate[bot]30f41ac
chore(deps): update dependency refit to 7.2.1 (#1844) @renovate[bot]f02e004
chore(deps): update dotnet monorepo (#1867) @renovate[bot]24e0444
chore(deps): update dependency serilog to 4.1.0 (#1899) @renovate[bot]101afad
chore(deps): update dependency verify.xunit to 26.5.0 (#1851) @renovate[bot]Contributions
New contributors since the last release: @mithileshz, @ted-ccm, @TeddyAssefa
Thanks to all the contributors: @ChrisPulman, @marcominerva, @mithileshz, @sguryev, @ted-ccm, @TeddyAssefa, @TimothyMakkison
The following automated services have also contributed to this release: @renovate[bot]
Configuration
📅 Schedule: Branch creation - "" (UTC), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.
This PR was generated by Mend Renovate. View the repository job log.