(Note, I originally wrote this on June 24th. Put off posting it as I
wanted to think it over and edit a bit more and then lost interest for
a bit... Tonight this is back on my radar and I'm announcing a virtual
hackathon for noon Saturday July 10th!)
----------
(Original June 24th deferred post)
Good news everybody,
The Manitoba Government has unintentionally created a white hat
reverse engineering contest that's of broad public interest.
The immunization card verification app was published for Android and
iThings Wednesday June 23rd.
Amoung other things (*) I don't like that this is proprietary software
with an undocumented API. Our Manitoba restaurateurs, who are able to
seat vaccine verified mixed households indoors as of Saturday June
26th should be able to meet their regulatory requirement to validate
these customers with free, libre open source software.
Nor should they be forced into the broadly proprietary world of
Android and iThings.
Broadly speaking, I believe the ability to communicate with one's
government should be through open protocols, just as we have open
laws.
(positive example, the CRA has an open XML format for employers submitting T4s)
So the contest is:
A) Reverse engineer the API used by the verification app.
B) Provide proof of concept alternative client implementation.
-----
I do not believe public health will be undermined by reverse
engineering this. From the outside, the protocol and app appears to be
properly designed and good protocols don't rely on their secrecy for
security. If a design problem was noticed, then this is a chance for
it to be reported and fixed.
I'm not concerned about the prospect of restaurateurs doing their own
app to perform a mix of guanine and fake verifications at their
discretion. This falls into the same category as not performing
verifications at all or just pretending to. They don't need the API to
commit that kind of fraud. For that reason, agencies performing
compliance checks are going to need to re-verify mixed household
indoor tables anyway. Opening up the protocol doesn't change the need
to actively enforce the public health rules in that manner with boots
on the ground.
An open protocol does lower the cost for a restauranterer to engage in
unethical logging of name + status. Though I doubt there's much
incentive and a lot more about patrons can be logged by way of
security cameras and contract tracing forms.
Bad actors will reverse engineer the API anyway. The value to good
actors of an open protocol outweighs this concern.
------------
What I know so far.
The app requires login to the portal found at the redirect for
https://immunizationcard.manitoba.ca . Registration is open, the
intention being that it is also the place where you can request your
own card.
After completing open registration you can log into the app. There
isn't a requirement that you go far enough with the portal to have
received your own card to use the verifier app.
The verifier app does QR scans. The immunization card QRs consist of
the portal base URL
https://immunizationcard.manitoba.ca/
and ends with ?ID=
and a unique user identifier.
source:
https://www.reddit.com/r/Winnipeg/comments/o0llyt/i_decoded_the_qr_code_on_the_proof_of_vaccination/
https://imgur.com/Gur6cDZ
The URL aspect is just there to document. Some people wondered if the
app would be dumb enough to just run an embedded browser on any URL.
It does not, I scanned "
https://gov.mb.ca" and got the nopes response.
So presumably the protocol and API is two step.
1) Login to the portal, results in some kind of cookie or token used in step 2
2) Requesting verification at a particular end point of vaccine status
with the identifier part from the vaccine card codes. Returned data is
the persons name and either "fully vaccinated" or "no data found"
One reverse engineering approach is to disassemble/decompile the app binary.
Another approach is to customize TLS certificate authority (CA)
storage on a device with the app, construct a private network where
you can mess with some combination of DNS and IPs and direct to an
alternative end-point with a TLS certificate signed by your own
self-generated certificate authority.
Doing so requires knowing the domain name of the end point that the
device is trying to reach so your own self-signed TLS certificate
matches that name. Discovering that name may just be a matter of being
in control of the DNS server queried or intercepting an unencrypted
DNS request. Tougher if an encrypted request to a specific DNS server
is made.
Worse case the end point domain name may need to be extracted by
dissassemble/recompile, and from there a network interception approach
to reverse engineering can be resumed.
Mark
[p.s. re among other things *, ask in private]
---------
UPDATE July 4th,
The Android app has been taken down!
https://www.reddit.com/r/Winnipeg/comments/od2t7h/what_happened_to_the_manitoba_immunization/
https://imgur.com/a/niUmAtB
This is a perfect example that an open API and libre implementation
are called for. Our government gave away our digital sovereignty
exclusively to the mobile app-store duopoly of Google and Apple and
has now reaped what it sowed.
Some poor government contractor is probably in the middle of trying
(on a weekend) to beg for the privilege of our government to publish
software to our own residents!
At the very least, an Android package should have been independently
published to provide an alternative pathway to Android devices that
ship without the Play Store.
(The most commonly seen ones are Amazon's Fire series. Are believe
there are also floss firmwares that don't have Play Store)
This could very well be causing some restaurateurs who are already
hurting to feel the need to buy additional iThings in the interim!
Therefore, I call for a hackathon on Saturday July 10th at noon.
I will be present on
https://meet.jit.si/ScientificBeesRetireSometime
#hackathon on Slack
#skullspace on Libera
Presumably by then Google will have shown mercy on our Province and
the Android app will be available again. That will not diminish the
need for the hackathon.
Our restaurateurs should not be forced into an abusive relationship
with Google or Apple to seat customers under this regulatory
requirement.
Open protocols, open APIs, open government!
Free, libre, open source software!
HACK THE PLANET!