Create rule S6377: XML signatures should be verified securely #8982
Labels
Area: C#
C# rules related issues.
Area: Security
Related to Vulnerability and Security Hotspot rules
Type: New Rule
Implementation for a rule that HAS been specified.
Milestone
Why
As part of MMF-3716, we want to close the gap between C# and other languages regarding cryptography related rules support. S6377 is one of the rules that is not currently supported by this analyzer.
What
S6377 aims to detect when XML signatures are insecurely validated. We want to add support for this behavior for both .NET core and .NET framework. Note that XML related cryptographic features are implemented as part of
system.security.cryptography.xml
a .NET platform extension.Detection logic
This rule should raise any time code validates a signature without relying on a trusted public key. In that case, the could would use the signature-embedded public key to perform the validation and would be open to forgery attacks.
We want to raise when:
System.Security.Cryptography.Xml.SignedXml.CheckSignature()
is called (without a parameter).System.Security.Cryptography.Xml.SignedXml.CheckSignatureReturningKey
is called.Example code
RSPEC
This rule's RSPEC (from this PR SonarSource/rspec#3814) contains information regarding messages and highlighting.
The text was updated successfully, but these errors were encountered: