Skip to content

Merge branch rel-10.5 with rel-10.4#25621

Merged
voloagent merged 3 commits into
rel-10.5from
auto-merge/rel-10-4/4649
Jun 11, 2026
Merged

Merge branch rel-10.5 with rel-10.4#25621
voloagent merged 3 commits into
rel-10.5from
auto-merge/rel-10-4/4649

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

This PR generated automatically to merge rel-10.5 with rel-10.4. Please review the changed files before merging to prevent any errors that may occur.

maliming and others added 3 commits June 11, 2026 11:32
hooks System.Linq.Dynamic.Core's QueryOptimizer so OrderBy / ThenBy
selectors derived from ISortedResultRequest.Sorting are constrained to
plain property or field access; anything else throws AbpValidationException
cover ThenBy, compound, chained method calls, args parameterization,
concurrent install, inheritance, empty / null sorting, culture and
case-sensitivity edges
…guard-10.4

fix(ddd): restrict dynamic sorting selectors to property/field access
@voloagent voloagent marked this pull request as ready for review June 11, 2026 10:04
Copilot AI review requested due to automatic review settings June 11, 2026 10:04
@voloagent voloagent merged commit ac4ca5f into rel-10.5 Jun 11, 2026
1 check passed
@voloagent voloagent deleted the auto-merge/rel-10-4/4649 branch June 11, 2026 10:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR backports a security hardening change into Volo.Abp.Ddd.Application by installing a Dynamic LINQ query optimizer hook that validates dynamic OrderBy/ThenBy selectors and rejects unsafe sorting expressions, along with a dedicated test project covering the guard behavior.

Changes:

  • Add AbpDynamicSortingGuard that inspects Dynamic.Core-generated OrderBy/ThenBy expression trees and throws AbpValidationException for disallowed selector shapes.
  • Install the guard during AbpDddApplicationModule.PreConfigureServices.
  • Add a new Volo.Abp.Ddd.Application.Tests project with comprehensive unit tests for accepted/rejected sorting expressions and installation behavior.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/Services/AbpDynamicSortingGuard.cs Introduces the query optimizer hook and expression visitors that enforce sorting selector validation.
framework/src/Volo.Abp.Ddd.Application/Volo/Abp/Application/AbpDddApplicationModule.cs Installs the guard during module pre-configuration so it is active by default.
framework/test/Volo.Abp.Ddd.Application.Tests/Volo/Abp/Application/Services/AbpDynamicSortingGuard_Tests.cs Adds tests validating allowed property sorting, blocked method/binary expressions, and install/reset behavior.
framework/test/Volo.Abp.Ddd.Application.Tests/Volo/Abp/Application/AbpDddApplicationTestModule.cs Defines the test module dependencies for integrated testing.
framework/test/Volo.Abp.Ddd.Application.Tests/Volo/Abp/Application/AbpDddApplicationTestBase.cs Adds an integrated test base configuring Autofac for the new test project.
framework/test/Volo.Abp.Ddd.Application.Tests/Volo.Abp.Ddd.Application.Tests.csproj Adds the new test project configuration and references.
framework/test/Volo.Abp.Ddd.Application.Tests/Volo.Abp.Ddd.Application.Tests.abppkg Declares the project package role as a test library.

Comment on lines +12 to +17
/// <summary>
/// Framework infrastructure. Hooks <see cref="ExtensibilityPoint.QueryOptimizer"/> so
/// every OrderBy / ThenBy expression built from a user-supplied sorting string is
/// constrained to plain property or field access. Methods, comparisons, ternaries
/// and constants in the sort key are rejected with <see cref="AbpValidationException"/>.
/// </summary>
[InlineData("(Age + 10) desc")] // binary arithmetic
[InlineData("(Age * Age) desc")] // binary arithmetic
[InlineData("(-Age) desc")] // unary negation wraps something; only Negate is allowed via base.VisitUnary, but the operand is a plain member so this passes — keep as accept check
public void Should_Reject_Compound_Or_Arithmetic_Expressions(string sorting)
@codecov

codecov Bot commented Jun 11, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 68.00000% with 16 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.35%. Comparing base (eafbf8b) to head (4d3d8b5).
⚠️ Report is 242 commits behind head on rel-10.5.

Files with missing lines Patch % Lines
...Abp/Application/Services/AbpDynamicSortingGuard.cs 65.95% 14 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           rel-10.5   #25621      +/-   ##
============================================
- Coverage     49.38%   49.35%   -0.04%     
============================================
  Files          3685     3686       +1     
  Lines        124308   124358      +50     
  Branches       9494     9499       +5     
============================================
- Hits          61392    61377      -15     
- Misses        61077    61156      +79     
+ Partials       1839     1825      -14     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants