What's being debated is what is "computer code", and whether this legislation makes any sense at all.
Honestly I wouldn't be surprised if some of the algorithmic trading firms are using GPT-4 or LLaMa-2 for some sentiment analysis tasks, in which case this might actually work.
Do they not track the names of foreign companies either?
Companies House data is consumed by a very large number of companies and organisations, some of whom probably are vulnerable to such attacks. Fixing them isn't something Companies House can do. The joke Bobby Tables company name that was registered deliberately wasn't actually a functioning SQL injection. If someone does try to register a name containing a real one, it seems like a good idea for Companies House to be able to reject it on those grounds. This is just giving them that ability, as part of a larger ability to reject names that are designed to mislead or facilitate fraud.
The knee-jerk HN Nelson laugh at everything the UK and EU governments do makes for tedious reading, especially when there are so many actually bad policies and laws to criticise.
I’m sure some will object to this as “big government gone mad” or whatever but it feels pretty common sense to me to at least try. No one actually needs to name their company after a SQL statement.
It turns out, even if Companies House computer systems are 100% secure, the same isn't true of downstream systems. Unfortunately, Companies House has decided that telling downstream systems to git gud isn't enough.
It allows : / . < > and " though which is enough to allow XSS.
Strangely, though, they don't allow lower case letters.
And yes, you can register a company named > LIMITED and someone has https://find-and-update.company-information.service.gov.uk/c...
Proper query building and sanitization is the only reasonable solution.
especially since input sanitization is cheaper than free these days. any libraries/orms/whatever made in the last 15 years that is worth actually using will do this by default, and usually make it a pain in the ass to turn off.
Company 10542519 was named "; DROP TABLE "COMPANIES";-- LTD"
Company SC656788 is still named ROBERT'); DROP TABLE STUDENTS; LIMITED
Company 08768324 named DROP TABLE CONSULTANTS; LTD
And company 12956509 was named "><SCRIPT SRC=HTTPS://MJT.XSS.HT></SCRIPT> LTD (which you'll note works)
There have always been certain restrictions on company names [1] containing words like 'Police' or 'Financial Conduct Authority' and you can't even name your company 'Insurance' without the permission of insurance regulators. So this new rule isn't particularly onerous.
In fact, under existing legislation they could have added 'script src' and 'drop table' to an existing list of sensitive words that aren't allowed.
[1] https://www.gov.uk/government/publications/incorporation-and...
Then someone should register a company named "<FONT FACE='COMIC SANS MS' COLOR='#0F0'>"
P.S: I'm personally not thrilled by the idea of having all Unicode characters allowed and people being allowed to use poo emojis as part of their company name.
I never did bother with actually making it an SQL injection; it was meant to be an in-joke between me and whoever at the client with tech chops set up the billing record, nothing more :)
Did it have an impact on your business? i.e. was it easier or harder to find clients? I would guess harder, but for me personally I'd be more likely to check you out with such an awesome name, so I'm quite curious
>>“in the opinion of the Secretary of State”
IDK specifically about English law, but I worked directly with the DMV in Vermont. Slightly outside of the project, but the state allows pretty much any vanity plates, of course with the law specifying "shall not be objectively obscene or confusing to the general public". But this leaves room for interpretation. I heard of an incident where a state trooper was sent to retrieve a plate that had inappropriately passed screening, reading "3MTA3" (read it in the mirror).
Laws do need to be sufficiently precise to be not abused with selective enforcement, but sufficiently flexible to handle edge cases.
The MP was being a bit disingenuous in querying this wording when she pondered whether the Secretary of State knew "his SQL from his Javascript".
In British law, this phrase is code for leaving the implementation details to the civil servants in the relevant ministry, who will have the de facto power to make law here. In this case that's probably a reasonable thing to do, rather than attempting to codify exactly what is or isn't computer code in the inflexible primary legislation. In general, though, it's a mechanism to reduce accountability and erode democracy.
https://find-and-update.company-information.service.gov.uk/c...
And a post from the person who registered it
https://pizzey.me/posts/no-i-didnt-try-to-break-companies-ho...
> [..] A company has been registered [..] under the name ; DROP TABLE "COMPANIES";-- LTD, which has some computer code around it.
As the post above points out, this would either work fine or cause an error, because of the quotes -- it's not actually SQL injection.
In theory, a system could have an actual vulnerability but if it does it would mean it's also going to fail on any name with a single or double quote in it (depending on the SQL dialect). Not sure why anyone would legislate a workaround to what is essentially a "intro to databases" level programming bug.
I suspect the actual reason for it coming up in law was because of the XSS company somebody registered some time after my meme went around. That one actually did work*, and as I understand it, there was no recourse available to companies house - they are legally obliged to accurately record company names, and the law specifies which characters can be in company names, meaning you could always serve XSS there, which they're not a fan of.
That said, they forced my company name to show as 'name available on request' now (even on letters they send me, which is kind of funny), so apparently they did find a workaround.
* On third party systems consuming the data*
X5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*
a valid company name in the UK?
: / . < > and "
smfh.
SQL isn't a problem--all user inputs become parameters, they don't get inlined.
Multiple layers. Tight code, sanitized inputs, guardrails, etc.
edit: OH YEAH AND ERROR MESSAGES WITH MORE THAN THE FUCKING USELESS,
"An error has occurred. Contact your Systems Admin, so he can be confused too, because we provided fuck all in diagnostic info in the error message!"
It doesn't matter as long as they aren't serving food.
https://web.archive.org/web/20231204144437/https://www.paral...
It's an entertaining link
previously
; DROP TABLE "COMPANIES";-- LTD - https://news.ycombinator.com/item?id=27815396 - July 2021 (30 comments)
Drop Table “Companies”;-- LTD - https://news.ycombinator.com/item?id=21534156 - Nov 2019 (7 comments)
Drop Table “Companies”;– LTD - https://news.ycombinator.com/item?id=20583540 - Aug 2019 (2 comments)
Drop Table Companies Ltd - https://news.ycombinator.com/item?id=17003588 - May 2018 (27 comments)
Drop Table Companies Ltd - https://news.ycombinator.com/item?id=13280494 - Dec 2016 (23 comments)
https://pizzey.me/posts/no-i-didnt-try-to-break-companies-ho...
Also link to previous discussion the company in question:
https://news.ycombinator.com/item?id=27815396
And link to the company: https://find-and-update.company-information.service.gov.uk/c...
- DROP TABLE LTD
- DROP TABLE USERS LTD
- DROP TABLE CONSULTANTS; LTD
- ROBERT'); DROP TABLE STUDENTS; LIMITED
[0] https://find-and-update.company-information.service.gov.uk/s...
Hello, I'm Mr. Null: https://www.wired.com/2015/11/null/
Falsehoods Programmers Believe About Names: https://www.kalzumeus.com/2010/06/17/falsehoods-programmers-...
SQL is a natural contender with potential queries like “select customers from store” but I'm curious how far this can be taken and what other “computer code” company names other languages would make possible.
Geeks and nerds are no longer the near universally admired weirdos bringing the wonderful future.