O2 UK's Weird MSISDN Lookup API
It's always fun keeping your network inspector tab open. While looking around the O2 UK website, I found this page all about eSIMs. For some reason, it wants to know the user's phone number.
I put in a random number, and it refused to let me in.

Putting in a genuine O2 number let me through. So what is it doing to validate numbers?
It is making an API call to this URl:
https://www.o2.co.uk/o/customer/mods/lookup/447700900123
After a bit of testing, this is how I think it works.
If you give it an O2 phone number, it replies with:
JSON
{"type":"ONE"}
If you give it a number which isn't on O2, it gives:
JSON
{"type":"ZERO"}
A number it doesn't recognise gives:
JSON
{"message":"Unable to find the requested resource."}
A malformed or incomplete phone number gives:
JSON
{"message":"Something's wrong. Please try again later."}
Responsible Disclosure?
As far as I can tell, O2 no longer have a Bug Bounty or Responsible Disclosure offering. So I'm publishing it here to let people know.
It is possible that someone could use this API to disclose a (minor) piece of personal information about you - namely whether your phone number is on O2 or not. I don't think that's particularly sensitive, but it is probably worth knowing.
Mike says:
My number is registered to Virgin Media and it'll show up as an O2 number Welcome to FreeCarrierLookup.com
Mike says:
More comments on Mastodon.