Little Bobby Tables applies for a TLS certificate, chaos ensues
Description
Screenshot of a Windows “Certificate Information” dialog. Top left shows the yellow-triangle-over-certificate icon. A bold heading reads “Certificate Information”. Below, in plain text, it says “Windows does not have enough information to verify this certificate.” The lower half lists fields: “Issued to:” followed by the payload “',1,1,1,1,1,1,1,1,1);ATTACH DATABASE'REPOSI~1\a.php'AS a;CREATE/*”. Next line is “Issued by:” with “*/TABLE a.b(c text);INSERT INTO a.b VALUES("<?= '$_GET[c]' ?>");”. Finally, “Valid from 8/6/2022 to 8/6/2023”. Visually it looks like a legit certificate window, but the issuer and subject are pure SQL/PHP injection strings, hinting at catastrophic input-sanitisation failures. For seasoned engineers, it’s a mash-up of broken PKI trust chains, unsanitised user input, and the perennial security vs. usability battle - basically every pentester’s fever dream rendered as a cert
Comments
19Comment deleted
Proof that if you let the same intern handle both PKI enrollment and input sanitisation, your chain of trust ends with DROP TABLE certificates;
When you've been debugging certificate chain validation for three days straight and realize the real vulnerability was trusting user input in the first place - because apparently even X.509 certificates aren't safe from Bobby Tables' descendants
When your certificate authority's input validation is so lax that attackers can literally ATTACH DATABASE in the CN field and Windows just shrugs with 'not enough information to verify' - as if the SQL injection payload wasn't information enough. This is what happens when your PKI infrastructure treats certificate fields as free-form text and your parsing logic has never heard of parameterized queries. The real kicker? Someone actually got this certificate issued and valid for a full year, proving that certificate transparency logs are the security industry's most entertaining bug bounty program
When even cert issuers skip prepared statements, your CN becomes a DROP TABLE waiting to happen
When the CN can ATTACH DATABASE and the issuer name executes PHP, your chain of trust just became dependency injection
Pro tip: if the CN reaches your ORM, TLS becomes an INSERT handshake
I'm fascinated, I want to know how that happened. Comment deleted
good sql escaping ¯\_(ツ)_/¯ Comment deleted
Not so much. If that was the result of successful SQL injection you'd see results, not the commands themselves. It's clearly a failed attempt at SQL Injection, but it's still interesting. Comment deleted
i literally meant that it was failed sql injection because of the query being properly escaped Comment deleted
I see. Though it's still unclear how exactly it got where it's at currently. Comment deleted
still you would expected a real CA in the "Issued by" field. I believe this is rather a future attempt to perform injection by sending this file to a system that parses certificate attributes and writes them into a database. Comment deleted
either that or something you could make using openssl on local machine Comment deleted
its crt injection😂 Comment deleted
for memes Comment deleted
Okay that's fake or RAM failure. You will never see , (comma) in entity name Comment deleted
Yeah that GUI doesn't even support more then 1 line of text anyway Comment deleted
That green thing is where the "label" is actually and it doesn't grow Comment deleted
I could change the size with this tool too but that beside the point Comment deleted