File tree Expand file tree Collapse file tree
CodeQL_Queries/csharp/TelerikRepeatedEncryptionKey Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+
2+ # Weak (duplicated) encryption keys for ASP.NET Telerik
3+
4+ ## Overview
5+
6+ ASP.NET Telerik upload allows developers to easily
7+ manage file uploads. The transmission between the client and the
8+ server must be encrypted and impossible to decode, so the data cannot
9+ be used by a malicious entity in an attack against the server. The
10+ main security recommendation for Telerik is setting custom unique
11+ strong random values for ` Telerik.AsyncUpload.ConfigurationEncryptionKey `
12+ and ` Telerik.Upload.ConfigurationHashKey ` .
13+
14+ The CodeQL query detects applications that are using the same key
15+ for both fields while they should have been unique
16+
17+ ## Recommendation
18+ Set a custom unique strong random value for
19+ ` Telerik.AsyncUpload.ConfigurationEncryptionKey ` .
20+
21+ Set a custom unique strong random value for
22+ ` Telerik.Upload.ConfigurationHashKey ` .
23+
24+ ## Example
25+
26+ The following example shows a secure configuration for Telerik Upload
27+ in the file ` Web.config ` .
28+ ```
29+ <appSettings>
30+ <add key="Telerik.AsyncUpload.ConfigurationEncryptionKey" value="YOUR-FIRST-UNIQUE-STRONG-RANDOM-VALUE-UNIQUE-TO-YOUR-APP" />
31+ <add key="Telerik.Upload.ConfigurationHashKey" value="YOUR-SECOND-UNIQUE-STRONG-RANDOM-VALUE-UNIQUE-TO-YOUR-APP" />
32+ <add key="Telerik.Upload.AllowedCustomMetaDataTypes" value="Telerik.Web.UI.AsyncUploadConfiguration" />
33+ </appSettings>
34+ ```
35+
36+ ## References
37+ - Telerik: [ Security Recommendations] ( https://docs.telerik.com/devtools/aspnet-ajax/controls/asyncupload/security ) .
38+ - Telerik: [ Cryptographic Weakness] ( https://www.telerik.com/support/kb/aspnet-ajax/details/cryptographic-weakness ) .
39+ - Exploitation: [ Pwning Web Applications via Telerik WebUI] ( https://captmeelo.com/pentest/2018/08/03/pwning-with-telerik.html ) .
40+
Original file line number Diff line number Diff line change 1+ /**
2+ * @name Non unique encryption keys in Telerik Upload in ASP.NET
3+ * @description Setting a weak encryption key for ASP.NET Telerik Upload may allow attacks against
4+ * the application.
5+ * @kind problem
6+ */
7+
8+ import csharp
9+
10+ from XMLAttribute a , XMLAttribute b
11+ where
12+ a .getName ( ) = "key" and
13+ a .getValue ( ) = "Telerik.AsyncUpload.ConfigurationEncryptionKey" and
14+ b .getName ( ) = "key" and
15+ b .getValue ( ) = "Telerik.Upload.ConfigurationHashKey" and
16+ a .getElement ( ) .getAttributeValue ( "value" ) = b .getElement ( ) .getAttributeValue ( "value" )
17+ select a ,
18+ "Non unique (duplicated) Telerik Upload encryption key (" +
19+ a .getElement ( ) .getAttributeValue ( "value" ) .toString ( ) + ")."
20+
You can’t perform that action at this time.
0 commit comments