[7.0.3 Cherry-pick] Address CodeQL findings: PKCS#1 padding (SM03799) - #4525
Conversation
|
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
e4df703 to
6dafaaf
Compare
There was a problem hiding this comment.
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 useRSASignaturePadding.Pkcs1per 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 Report✅ All modified and coverable lines are covered by tests.
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
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Cherry-pick of #4517 (
c64219683c7156a91231411c9587cdf00f27850b) intorelease/7.0.Conflict resolution
The original commit touched two areas:
ColumnMasterKeyMetadata.cs,EncryptedColumnEncryptionKeyParameters.cs) — applied cleanly, included here.tools/PackageValidatorweak-hash (SM02196) changes — dropped.tools/PackageValidatordoes not exist onrelease/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.
net9.0build succeeds with 0 warnings / 0 errors