Repository navigation
[release/11.0.2xx] Avoid redundant dataflow in security analyzers - #56581
Merged
tannergooding merged 4 commits intoNov 2, 2026
Conversation
Skip whole-method flow when no relevant sink is reachable and omit value-content flow when it cannot affect mapped operations. Preserve diagnostic behavior for implicit calls, initializers, conditional branches, and helper methods. Co-authored-by: Copilot App <[email protected]> (cherry picked from commit a5a0b02)
Co-authored-by: Copilot App <[email protected]> (cherry picked from commit 7d020c1)
Co-authored-by: Copilot App <[email protected]> (cherry picked from commit 57a73a7)
|
Azure Pipelines: Successfully started running 1 pipeline(s). 2 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Both value-content prepasses omit exception-filter control flow, potentially introducing false-positive diagnostics.
2 open findings
What changed in this PR
Backports security-analyzer performance optimizations that avoid redundant taint and value-content analyses while preserving diagnostic behavior.
Changes:
- Adds sink-reachability and value-content prepasses.
- Adds constant-value and constructor fast paths.
- Expands C#/VB correctness and performance regression tests.
| File | Description |
|---|---|
UseSharedAccessProtocolHttpsOnlyTests.cs |
Tests direct protocol constants and analysis counts. |
TaintedDataAnalyzerTestBase.cs |
Adds reusable flow-counting scenarios. |
ReviewCodeForXssVulnerabilitiesTests.cs |
Covers reachability and initializers. |
ReviewCodeForSqlInjectionVulnerabilitiesTests.cs |
Covers sink-free and helper paths. |
DoNotUseWeakKDFInsufficientIterationCountTests.cs |
Covers implicit calls, branches, and VB. |
DoNotUseInsecureDeserializerJsonNetWithoutBinderTests.cs |
Tests value-content avoidance and helpers. |
DoNotInstallRootCertTests.cs |
Adds constructor and VB coverage. |
DoNotHardCodeEncryptionKeyTests.cs |
Tests reachability, single analysis, and branches. |
DoNotHardCodeCertificateTests.cs |
Covers constructors and helper sinks. |
DoNotDisableSchUseStrongCryptoTests.cs |
Tests direct switch filtering. |
CountingCSharpSecurityAnalyzerTest.cs |
Adds analyzer instrumentation harness. |
TaintedDataAnalysis.TaintedDataOperationVisitor.cs |
Recognizes literal arrays without value-content flow. |
TaintedDataAnalysis.cs |
Makes value-content analysis conditional. |
PropertySetAnalysis.PropertySetDataFlowOperationVisitor.cs |
Supports direct constructor mapping. |
PropertySetAnalysis.cs |
Adds value-content necessity prepass. |
ConstructorMapper.cs |
Adds value-independent constructor mapping. |
UseSharedAccessProtocolHttpsOnly.cs |
Handles constant protocols directly. |
SourceTriggeredTaintedDataAnalyzerBase.cs |
Adds sink reachability and single-pass analysis. |
DoNotUseWeakKDFInsufficientIterationCount.cs |
Maps default-iteration constructors directly. |
DoNotUseInsecureDeserializerJsonNetWithoutBinder.cs |
Adds analysis instrumentation. |
DoNotSetSwitch.cs |
Avoids flow analysis for known benign constants. |
DoNotInstallRootCert.cs |
Maps parameterless stores directly. |
🧠 Review effort: Balanced
Keep exception-path analysis from propagating data through blocks that prerequisite analyses determine are infeasible. Co-authored-by: Copilot App <[email protected]>
jeffhandley
approved these changes
Oct 27, 2026
jeffhandley
left a comment
Member
There was a problem hiding this comment.
This looks good to me, and I am supportive of the backport to 11.0 servicing.
/cc @artl93
Member
|
@artl93 - Sending to you for review and backport consideration for post-GA 11.0 servicing. Per previous agreement on analyzers and SDK updates, these do not need to flow through Tactics, we just need local team approval, so it's your call on this and others like it. /cc @tannergooding |
tannergooding
had a problem deploying
to
copilot-pat-pool
November 2, 2026 18:17 — with
GitHub Actions
Failure
tannergooding
deleted the
tannergooding-backport-56415-release-11.0.2xx
branch
November 2, 2026 18:17
This branch had an error being deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.

Note
This backport description was drafted with GitHub Copilot.
Backport of #56415 to
release/11.0.2xxFixes #56413.
Customer Impact
CA5390 and CA5403 spent substantial analyzer time processing thousands of literal byte-array call sites even when no relevant cryptographic sink was reachable. Issue #56413 documents a 2,048-call reproduction where the analyzers accounted for 42.179 and 10.426 seconds of a 53.97-second build. The source PR's targeted reproduction measured about 128 seconds before and 2.3–2.5 seconds after. This backport skips sink-free methods and runs taint analysis once per method, while retaining value-content analysis when source recognition or control-flow decisions require it.
Regression
This is an analyzer performance optimization intended to preserve diagnostic behavior. Reachability checks account for implicit calls, initializers, branches, recursive helpers, and other cases that cannot be covered by a simple source-operation walk; ambiguous cases retain the full analysis. Regression tests cover these paths.
Testing
The NetAnalyzers solution build succeeded with 0 warnings and 0 errors. Focused tests on
release/11.0.2xxpassed: 348 passed, 1 skipped, 0 failed across the affected analyzer test classes.Risk
Production changes are limited to security-analyzer dataflow and property-set analysis; no public API or diagnostic ID changes. The implementation keeps conservative fallbacks where reachability or value mapping cannot be established safely.