Skip to content

[7.0.3 Cherry-pick] Address CodeQL findings: PKCS#1 padding (SM03799) - #4525

Merged
cheenamalhotra merged 1 commit into
release/7.0from
dev/automation/pr-4517-to-7.0.3
Aug 11, 2026
Merged

[7.0.3 Cherry-pick] Address CodeQL findings: PKCS#1 padding (SM03799)#4525
cheenamalhotra merged 1 commit into
release/7.0from
dev/automation/pr-4517-to-7.0.3

Conversation

@github-actions

@github-actions github-actions Bot commented Aug 10, 2026

Copy link
Copy Markdown

Cherry-pick of #4517 (c64219683c7156a91231411c9587cdf00f27850b) into release/7.0.

Conflict resolution

The original commit touched two areas:

  1. Always Encrypted PKCS#1 suppressions (ColumnMasterKeyMetadata.cs, EncryptedColumnEncryptionKeyParameters.cs) — applied cleanly, included here.
  2. tools/PackageValidator weak-hash (SM02196) changesdropped. tools/PackageValidator does not exist on release/7.0, so these changes are not applicable to this branch (modify/delete conflict).

The empty placeholder commit created by the automation was removed; the branch now contains only the real cherry-picked change rebased onto release/7.0.

Changes

Annotates the RSA sign/verify call sites with // CodeQL [SM03799] suppressions. Always Encrypted mandates RSA PKCS#1 v1.5 signature padding for both the encrypted CEK blob and the column master key metadata; these formats are fixed by the specification and consumed by SQL Server tooling and other drivers, so switching to PSS would break interoperability.

Comment-only change — no behavior change.

  • Tests added or updated — N/A (comment-only)
  • Public API changes documented — N/A
  • Verified against customer repro — N/A
  • Ensure no breaking changes introduced — verified net9.0 build succeeds with 0 warnings / 0 errors

@github-actions github-actions Bot added this to the 7.0.3 milestone Aug 10, 2026
@github-project-automation github-project-automation Bot moved this to To triage in SqlClient Board Aug 10, 2026
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

…196) (#4517)

* Suppress CodeQL SM03799 for Always Encrypted PKCS#1 signatures

Always Encrypted requires RSA PKCS#1 v1.5 signature padding for both the
encrypted CEK blob and the column master key metadata. These formats are
fixed by the Always Encrypted specification and are produced/consumed by
SQL Server tooling and other drivers, so switching to PSS would break
interoperability.

Annotate the sign/verify call sites in EncryptedColumnEncryptionKeyParameters
and ColumnMasterKeyMetadata with CodeQL [SM03799] suppression comments,
matching the existing SM03796 suppressions for RSA-OAEP(SHA1).

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 31c7a5d9-05c5-4a0c-bf1b-9bad1fc87d12

* Address CodeQL SM02196 weak hash findings in PackageValidator

Drop SHA1 from the portable PDB checksum algorithm map. Modern compilers
record SHA-2 checksums, and an unrecognized algorithm already degrades to
an inconclusive result rather than a failure, so this is a no-op in
practice while removing an SDL-banned hash.

Suppress the finding on ComputePublicKeyToken, where SHA-1 is mandated by
ECMA-335 for strong-name public key tokens and is used purely as an
identity computation.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 31c7a5d9-05c5-4a0c-bf1b-9bad1fc87d12

* Potential fix for pull request finding

Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>

---------

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Copilot-Session: 31c7a5d9-05c5-4a0c-bf1b-9bad1fc87d12
@cheenamalhotra
cheenamalhotra force-pushed the dev/automation/pr-4517-to-7.0.3 branch from e4df703 to 6dafaaf Compare August 10, 2026 22:17
@cheenamalhotra
cheenamalhotra marked this pull request as ready for review August 10, 2026 22:17
@cheenamalhotra
cheenamalhotra requested a review from a team as a code owner August 10, 2026 22:17
Copilot AI lite review requested due to automatic review settings August 10, 2026 22:17
@cheenamalhotra cheenamalhotra changed the title [7.0.3 Cherry-pick - CONFLICTS] Address CodeQL findings: PKCS#1 padding (SM03799) and weak hash (SM02196) [7.0.3 Cherry-pick] Address CodeQL findings: PKCS#1 padding (SM03799) Aug 10, 2026

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

Cherry-picks the Always Encrypted portion of #4517 into the release/7.0 line to address CodeQL finding SM03799 by documenting/suppressing the required use of RSA PKCS#1 v1.5 signature padding, which is mandated for Always Encrypted interoperability.

Changes:

  • Added // CodeQL [SM03799] suppression comments at RSA sign/verify call sites that must use RSASignaturePadding.Pkcs1 per the Always Encrypted format/spec.
  • Minor XML doc comment cleanup in ColumnMasterKeyMetadata.Verify (removed an extraneous trailing quote).

Reviewed changes

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

File Description
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/AlwaysEncrypted/EncryptedColumnEncryptionKeyParameters.cs Adds CodeQL suppressions around RSA sign/verify operations that must use PKCS#1 v1.5 for Always Encrypted CEK blob integrity.
src/Microsoft.Data.SqlClient/src/Microsoft/Data/SqlClient/AlwaysEncrypted/ColumnMasterKeyMetadata.cs Adds CodeQL suppressions for PKCS#1 v1.5 signing/verification of CMK metadata; cleans up an XML doc comment typo.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@codecov

codecov Bot commented Aug 11, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 65.72%. Comparing base (440074d) to head (6dafaaf).

❗ There is a different number of reports uploaded between BASE (440074d) and HEAD (6dafaaf). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (440074d) HEAD (6dafaaf)
CI-SqlClient 1 0
Additional details and impacted files
@@               Coverage Diff               @@
##           release/7.0    #4525      +/-   ##
===============================================
- Coverage        74.63%   65.72%   -8.92%     
===============================================
  Files              280      275       -5     
  Lines            43923    65957   +22034     
===============================================
+ Hits             32782    43349   +10567     
- Misses           11141    22608   +11467     
Flag Coverage Δ
CI-SqlClient ?
PR-SqlClient-Project 65.72% <100.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ 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.

@cheenamalhotra
cheenamalhotra merged commit e1e934e into release/7.0 Aug 11, 2026
302 checks passed
@cheenamalhotra
cheenamalhotra deleted the dev/automation/pr-4517-to-7.0.3 branch August 11, 2026 15:46
@github-project-automation github-project-automation Bot moved this from To triage to Done in SqlClient Board Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

4 participants