telerik: overhaul, native RAU + DialogHandler crypto#3333
Open
liquidsec wants to merge 10 commits into
Open
Conversation
Refactor into per-technique async methods, replace RAU_crypto.py subprocess loop with native badsecrets-primitive payload builder. Add CVE-2017-9248 oracle probe (dp_cryptomg quick_check port) and DialogHandler known-key spray (PBKDF1_MS + PBKDF2 via badsecrets keylists). Standardize FINDING name values on CVE + handler. Config: exploit_rau (renamed from exploit_RAU_crypto), try_known_keys, probe_dialoghandler_oracle, include_machinekeys. Deps: drop deps_ansible + pycryptodome, add badsecrets.
Replace KDF-fingerprint shortcut for the DialogHandler oracle probe with the actual dp_cryptomg find_baseline algorithm: iterate the 3^4 byte combinations of [0x00, 0x6b, 0x08] as GET ?dp=<b64> payloads and read for 'Index was outside the bounds of the array' / 'String was not recognized as a valid Boolean'. On hit, emit CRITICAL/CONFIRMED. Reorder DH exploit: try known-key spray first (definitive, recovers the actual keys); only fall back to the byte-oracle baseline probe if no key matches. Oracle probe is gated to PBKDF1_MS mode since the CVE-2017-9248 patch moved to PBKDF2 specifically to defeat it. DialogHandler discovery tries the default path (Telerik.Web.UI. DialogHandler.aspx at root) sequentially first; the handler is global and this produces a less confusing finding URL. Only fan out to the extended candidate list if the default misses.
Detect CVE-2017-11317 exploitability without uploading a file. Send default-keys payloads targeting a fake assembly version (9999.9.999); if the server responds with 'Could not load file or assembly', crypto succeeded and .NET rejected the bogus version before any file write. Emit HIGH/HIGH 'Telerik RAU Default Keys Accepted' finding. Try each (KDF, HMAC) combination pre-patch targets can use: PBKDF1_MS no-HMAC (pre-2017), PBKDF1_MS with HMAC (2017.1.118 - 2018.1.117), PBKDF2 with HMAC (2018.2+). First hit exits. exploit_rau=True still runs the full version iteration for the CRITICAL/CONFIRMED RCE finding; version identification and RCE confirmation are the same operation. Fix: version fingerprint used to send version 2014.3.1024, a real Telerik version. On a target actually running that version, that was an accidental file upload during 'default' scanning.
The safe fake-version probe already detects RAU exploitability by default; this opt-in specifically identifies the exact installed version by uploading a benign 1-byte file. Old name misrepresented its role. Description now warns explicitly about the file write.
Safe RAU probe now sprays the full badsecrets keylist (not just the two hardcoded defaults), split into Default vs Known findings by key source. Version list picks up badsecrets' patched set + undotted variants; adopts quoted Version="X" and lowercase C:\\windows\\temp\\ per badsecrets. custom_secrets wired through. rau_confirm_version defers HIGH until version-check runs — CRITICAL alone on match, HIGH fallback (with attempted-but-failed wording) on miss. Verbose step messages throughout. dotnet-audit preset uses rau_confirm_version.
Post-patch DialogHandlers validate input length before touching crypto, so the short AAAA fingerprint probe returns 'Invalid length for a Base-64' regardless of the actual KDF. Real known-key probes are long enough to pass that gate, so spray PBKDF1_MS then PBKDF2 when the classifier can't tell. Catches weak-custom-key configs on hardened targets that would otherwise fall through with no attempt.
badsecrets sees the same string and silently keeps its initial PBKDF1_MS default; it's an input-length gate, not a patch signal. Returning None makes the exploit path try both KDFs (my prior change), which is strictly more coverage than badsecrets' PBKDF1_MS-only fallback.
dp_cryptomg does no KDF classification before find_baseline — it just tries the byte oracle and reads response strings. My PBKDF1_MS-only gate skipped legitimate oracle-vulnerable targets whose short KDF-fingerprint probe was rejected by an input-length gate (kdf_mode = None). Only skip when the classifier explicitly reported PBKDF2 (where the CVE-2017-9248 patch fixed the oracle by design).
Add DialogHandler version detection using the recovered hash/enc keys (safe, size-diff probe, mirrors badsecrets' DialogHandler.probe_version). Emit follows the RAU pattern: CRITICAL/CONFIRMED with version, HIGH/HIGH fallback when target's version isn't in the candidate list. Thread RAU-confirmed version through to DH oracle + known-key findings. Both handlers back onto the same Telerik.Web.UI install, so an RAU-confirmed version fills in the DH side when DH can't identify it directly (strong custom DH keys). Also fix DH known-key test mock to model version detection correctly (assembly type string is base64-encoded inside the plaintext) and assert CRITICAL + version in the finding.
_rau_confirmed set added nothing on top of _incoming_dedup_hash: URL events dedupe per-netloc (default) or per-normalized-URL (include_subdirs), and either way the same base_url can't reach _probe_rau twice. Also: rename stale exploit_rau -> rau_confirm_version in a test message and add missing f-string prefix on another.
Contributor
📊 Performance Benchmark Report
📈 Detailed Results (All Benchmarks)
🎯 Performance Summary+ 1 improvement 🚀
30 unchanged ✅🔍 Significant Changes (>10%)
🐍 Python Version 3.11.15 |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #3333 +/- ##
======================================
- Coverage 90% 90% -0%
======================================
Files 450 450
Lines 46308 46656 +348
======================================
+ Hits 41565 41862 +297
- Misses 4743 4794 +51 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Summary
Rewrite of the
telerikmodule.rau_cryptoshell-out; AES-CBC done natively.9999.9.999assembly version, flags exploitable RAU without writing a file. Opt-inrau_confirm_versionwalks candidate versions and uploads a 1-byte file on match for CRITICAL.badsecretstelerik_knownkeyfor known-key spray on DialogHandler (PBKDF1_MS + PBKDF2).dp_cryptomg(find_baseline, 81-combo?dp=...probe) as a fallback when known-key spray misses.dotnet-auditpreset opts intorau_confirm_version+include_subdirs.