Technical articles migrated from Yuque.
[CVE-2022-36804] Bitbucket Pre-auth RCE Vulnerability
Critical severity command injection vulnerability - CVE-2022-36804 Official advisory: https://confluence.atlassian.com/bitbucketserver/bitbucket-server-and-data-center-advisory-2022-08-24-1155489835.html Let’s diff 8.3.0 vs 8.3.1, and get familiar with the workflow of diffing jar packages in IDEA along the way: https://product-downloads.atlassian.com/software/stash/downloads/atlassian-bitbucket-8.3.0-x64.bin https://product-downloads.atlassian.com/software/stash/downloads/atlassian-bitbucket-8.3.1-x64.bin Analyzing the patch, two suspicious spots were found: patch#1 found bitbucket/atlassian-bitbucket-8.3.0-x64/app/WEB-INF/lib/nuprocess-2.0.2-atlassian-3.jar!/com/zaxxer/nuprocess/NuProcessBuilder.class the patch#1 is like: this.ensureNoNullCharacters(commands); A new method ensureNoNullCharacters was added command.indexOf(0): checks whether the command contains the \u0000 character If it does, an exception is thrown directly: Commands may not contain null characters — you can add this hint value in your PoC private void ensureNoNullCharacters(List<String> commands) { Iterator var2 = commands.iterator(); String command; do { if (!var2.hasNext()) { return; } command = (String)var2.next(); } while(command.indexOf(0) < 0); throw new IllegalArgumentException("Commands may not contain null characters"); } The full patch is below: ...