Repository navigation
fix(serialization): bind assembly lookup and authorize generic roots - #11456
Conversation
There was a problem hiding this comment.
🟢 Approval recommended
The scoped authorization fixes are consistent with the documented policy and have focused regression coverage.
0 open findings
What changed in this PR
This PR closes two serialization type-authorization gaps while preserving unqualified resolution and CLR type forwarding.
Changes:
- Binds qualified type resolution to the specified assembly.
- Independently authorizes generic definitions and checks all arguments for denials.
- Adds regression coverage and updates security/configuration guidance.
| File | Description |
|---|---|
src/Orleans.Serialization/TypeSystem/CachedTypeResolver.cs |
Prevents qualified lookups from falling back outside the specified assembly. |
src/Orleans.Serialization/TypeSystem/TypeConverter.cs |
Strengthens generic-root and argument authorization. |
test/Orleans.Serialization.UnitTests/TypeConverterTests.cs |
Adds focused authorization and resolution regressions. |
docs/site/src/content/docs/security/serialization.md |
Documents generic authorization security behavior. |
docs/site/src/content/docs/host/configuration-guide/serialization-configuration.md |
Explains configuration and filter semantics. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Code coverage
Report-only conclusion: current-main baseline stale. The newest successful coverage run tested 6138d8b, not current main d726b68. Coverage combines every CI test matrix job, including providers, CodeGen, .NET 8/10, Linux, Windows, and macOS, using canonical physical source and branch identities. The comparison remains report-only while normal line and branch variance is calibrated. Coverage details |
…otnet#11456) (cherry picked from commit d726b68) Upstream-PR: dotnet#11456 Upstream-Commit: d726b68
…otnet#11456) (cherry picked from commit d726b68) Upstream-PR: dotnet#11456 Upstream-Commit: d726b68
Two type-authorization gaps let an assembly-qualified lookup fall back to a type outside the specified assembly and let approved generic arguments authorize an otherwise unknown generic root.
Bind qualified resolver callbacks to
Assembly.GetType, preserving unqualified resolution and CLR type forwarding. In the resolved-type fallback, authorize generic definitions independently using existing manifest, name, assembly, and filter grants. Inspect later generic arguments after an unknown argument so an explicit denial still takes precedence.Preserve explicit
ITypeFiltergrants for a closed generic construction, including unknown arguments, while honoring argument denials. Add focused regressions and update the serialization configuration and security guidance. These are scoped authorization corrections, with no public API changes.Microsoft Reviewers: Open in CodeFlow