-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Process terminated. Infinite recursion during resource lookup within System.Private.CoreLib - Argument_InvalidResourceCultureName #86441
Comments
Tagging subscribers to this area: @dotnet/area-system-globalization Issue DetailsWe are getting an infinite recursion in System.Private.CoreLib while looking up a localization string via IStringLocalizer. Runtime environment: k8s (aspnet:6.0.16-alpine3.17-amd64) - does not reproduce on Windows This seems to be a very specific case - if a "-u-" is included in the locale (e.g., "ar-SA-u-NU-latn"). Other locales do not seem to trigger this issue (e.g., "ar-SA"). Example code to trigger the issue:
Stack Trace:
|
Currently the extensions locale names are not handled correctly. We call ICU |
@tarekgh is there any plans to make it safe and handle this internally? It looks weird to have a .net functionality that under certain arguments get not an |
I totally agree. If the data comes from a client request, then it can be used to crash a service. @tarekgh could this be a potential vulnerability? |
@stvonolf @IhnatKlimchuk I am keeping the issue open to track fixing it. Yes, we'll provide a fix for that. Thanks! |
FYI, looks like affected cultures can be detected by 2 tests:
|
When creating a culture with extensions part |
@tarekgh Well... that's not the only case. I was playing around and here my findings:
but here is a interesting one:
Btw, tested on |
Why do you think this is more interesting than the regular I am aware of all these cases, and I'll do the fix for all of them. Thanks for the feedback. |
Fixed by the attached PRs and also ported the fix to .NET 6.0 and .NET 7.0. |
We are getting an infinite recursion in System.Private.CoreLib while looking up a localization string via IStringLocalizer.
Runtime environment: k8s (aspnet:6.0.16-alpine3.17-amd64) - does not reproduce on Windows
.net SDK version: 7.0.302
This seems to be a very specific case - if a "-u-" is included in the locale (e.g., "ar-SA-u-NU-latn"). Other locales do not seem to trigger this issue (e.g., "ar-SA").
Example code to trigger the issue:
Stack Trace:
The text was updated successfully, but these errors were encountered: