-
Notifications
You must be signed in to change notification settings - Fork 22
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
[BUG]: missing HTTP headers sanitization in msgraph-cli
/whole .NET Core
#477
Comments
I'm seeing others reporting issues with other .NET tools on the Nix community chat |
msgraph-cli
, most likely .NET Core wide
see: - microsoftgraph/msgraph-cli#477 - NixOS/nixpkgs#315574 Signed-off-by: Krzysztof Nazarewski <[email protected]>
msgraph-cli
, most likely .NET Core widemsgraph-cli
/whole .NET Core
this version is finally working fixes issues with lack of HTTP header sanitization in .NET Core, see: - NixOS/nixpkgs#315574 - microsoftgraph/msgraph-cli#477 Signed-off-by: Krzysztof Nazarewski <[email protected]>
Hi, thanks for raising this issue. Since this affects all .NET programs, maybe reporting it in the .NET repository can also get the team's attention. See dotnet/sdk What do other programs like curl and the browser do with the user agent string on NixOS (I've never used this distro)? I wouldn't want to add header sanitization to this CLI since there's no agreed upon protocol as far as I can tell for doing this reliably. i.e. if I encode a header value, will the server decode it reliably and get the same data I encoded? We also cannot add the specific scenario since that's not scalable. I think the best way forward would be to somehow update these values on the OS config and remove/replace the unicode characters. |
NixOS is not doing anything special in this regard, there were other distros with unicode characters in release names. I might be missing something, but there are RFC 5987 and RFC2231 before that defining what should happen: basically urlencode the values. I am pretty sure (last time I checked/was concerned with it was around 2016) web browsers are doing just this. As far as I remember Python's
I can easily imagine automatically (and unconditionally) reading a value directly into HTTP header being some kind of attack vector.
|
I'm not actually sure where does it take the
edit: this search seems to give some clue https://github.com/search?q=org%3Adotnet+%22PRETTY_NAME%22+language%3AC%23&type=code |
Related: @andrueastman Shall we implement the escaping across all languages? |
This has been fixed in Azure/azure-sdk-for-net#44386 and will be released in Azure.Core 1.40. |
Thanks @m-redding The user agent header sent by Kiota libraries does not include the OS information (only the language and version of kiota). So, the header here is sent by the Azure library. Once we update the azure dependency to 1.40, we should retest and evaluate whether the header is cleaned up. |
I don't want to spend a day trying to find the right place to file the bug, but looks like whatever
msgraph-cli
uses does sanitize the HTTP Header values properly.Latest version of NixOS has a unicode character in release codename
Vicuña
:/etc/lsb-release
and/etc/os-release
User-Agent:azsdk-net-Identity/1.10.4 (.NET 8.0.5; NixOS 24.11 (Vicuña))
Request headers must contain only ASCII characters.
related:
ñ
in release codename and lack of HTTP headers sanitization NixOS/nixpkgs#315574The text was updated successfully, but these errors were encountered: