Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for CA/NY/LA/VA/HI/UT/NJ/MN/DE/CT/NV/NM/OK/KY/GU/MP/YT/BC/SK/AB/NT/NS/MB/ON/NL/PE/Cayman Islands vaccine records, other changes #6

Open
wants to merge 40 commits into
base: main
Choose a base branch
from

Conversation

steven676
Copy link

@steven676 steven676 commented Jun 19, 2021

This patch series makes a number of changes:

  • Make signature verification optional in the webapp, which makes debugging and casual inspection easier.
  • Add support for detecting which keys to use to verify SHC signatures using the iss field.
  • Enable signature verification for California digital vaccine records (closes System believes CA State SHC cards are fake #4)
  • Various quality-of-life improvements: stop the camera in the webapp once a barcode is read; behave better when QR codes that aren't valid SHCs are presented.

Note that this patch series currently (probably) breaks signature verification of Quebec vaccination proofs -- I need to fill in the iss value for Quebec at https://github.com/steven676/shc-covid19-decoder/blob/main/src/issuers.js#L4, which I can't find anywhere public.

Lightly tested with valid California vaccine records, the sample record at https://github.com/dvci/health-cards-walkthrough/blob/main/SMART%20Health%20Cards.ipynb, and a number of non-SHC QR codes.

This is in preparation for the ability to handle multiple issuers.
… record

We'll need this to detect the issuer.
This will allow us to verify SHCs from multiple issuers.  Note that this
requires decoding the data before verifying it; this is probably a bad
idea (similar to violating Moxie Marlinspike's rule of thumb that MAC
verification should come before any other receive-side operations in a
protocol [1]), but well, we're stuck with this format ...

[1] https://moxie.org/2011/12/13/the-cryptographic-doom-principle.html
Key from https://myvaccinerecord.cdph.ca.gov/creds/.well-known/jwks.json:

$ sha256sum jwks.json
eb5d4bbea0734c205daf49c03e3013071c9edfd6232d24451fdfc27c6637df5f  jwks.json
In particular, try to handle cases where corrupt/invalid SMART health
cards, or things that aren't SHCs at all, are scanned.
]
},
{
id: "us.ca",
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you instead use the iss in the provided QR code and download from there? This will make it work for more than just these 2 states then.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about this -- it'd certainly be more convenient for debugging and curiosity-driven inspection. But anyone can generate codes according to the spec, so you'd end up accepting things generated by, say, fakes.antivaxxers.dumb ... For actual verification purposes, you need a list of trusted issuers even if you fetch the keys on the fly from the spec-mandated location.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that totally makes sense. Is there anywhere else collecting a list of trusted issuers? This seems like the start of the common root CAs problem with SSL first came along...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's something calling itself the Common Trust Network, which unfortunately seems extremely light on details and doesn't seem to have a documented way of fetching the issuers list. (If you pull apart their verifier app, you can find an undocumented API endpoint to get the list, but (1) I don't know if they actually want other people using it and (2) it appears to cover US issuers only.)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, that's neat, thanks. (Still seems to cover US issuers only, though.)

@steven676 steven676 changed the title WIP: Add support for California vaccine records, other changes Add support for California vaccine records, other changes Jul 20, 2021
@steven676
Copy link
Author

A number of changes to my pull request:

@steven676
Copy link
Author

Thanks for this. I suppose we should know better than to assume everyone has implemented all of the spec correctly ... Are your current QR codes signed by the same key as we have in the codebase now, or do the different kid values correspond to different signing keys?

@steven676 steven676 changed the title Add support for California vaccine records, other changes Add support for California/New York/Louisiana vaccine records, other changes Aug 23, 2021
@steven676
Copy link
Author

I added two more signing keys, for the LA Wallet system used by the state of Louisiana and the Excelsior Pass Plus (NOT the Excelsior Pass!) used by the state of New York.

@superay123 can you confirm that it's only the kid that's been changing for the Quebec signing key, not the actual key parameters x/y? If x/y are stable, I'll pick 4d47866 from your branch into my branch.

@superay123
Copy link

superay123 commented Aug 24, 2021 via email

@steven676
Copy link
Author

I cherry-picked the kid and iss URL change from @superay123 (with a whitespace adjustment). Given the instability in Quebec's kid, though, I wonder whether we should go back to my original approach of using the iss URL to identify the signing key (I kept that code around in my verify-by-issuer branch).

@superay123 Thanks for the reminder -- I also updated the build at https://steven676.github.io/shc-covid19-decoder/ if anyone wants to test it out.

@superay123
Copy link

I scanned our QR codes that were downloaded today with https://steven676.github.io/shc-covid19-decoder/.
Both worked OK

dump_shc.js Outdated Show resolved Hide resolved
Node.js "helpfully" tries to reduce the amount of output when we pass
the decoded object to console.log(), so we need to pretty-print it
ourselves before displaying.  Fixes #2.  (Thanks to Dave Hughes for the
suggstion to use console.dir() to preserve the color-coding.)
Key from https://ekeys.ny.gov/epass/doh/dvc/2021/.well-known/jwks.json:

$ sha256sum jwks.json
b1e12070123acae094fd0047ae4d6b2d8aabe2f1c592932a224e83b83c9d6e2e  jwks.json
Key from https://healthcardcert.lawallet.com/.well-known/jwks.json:

$ sha256sum jwks.json
fede561fb56d82e82df8a6e5f5f2679460b7a4051a927ec318decf686199b633  jwks.json
Thanks to Raymond Ménard for these values.
Key from https://pvc.service.yukon.ca/issuer/.well-known/jwks.json:

$ sha256sum jwks.json
22e4ad57812178ed419aab7fcbd2c39d083f043b8e9f109e0654436584647ce8  jwks.json

(Found through the-commons-project/vci-directory#60.)
Key from https://smarthealthcard.phsa.ca/v1/issuer/.well-known/jwks.json:

$ sha256sum jwks.json
dc6c1e25fecbaa4362cd17ede14e862071bc5a0bd74085b7f37a2d369c61e810  jwks.json

With thanks to Mitch Brown and Dave Hughes; closes fproulx#14.
@steven676 steven676 changed the title Add support for California/New York/Louisiana vaccine records, other changes Add support for California/New York/Louisiana/Yukon/BC vaccine records, other changes Sep 13, 2021
peacey and others added 9 commits October 8, 2021 22:05
[[email protected]: key from https://www.hss.gov.nt.ca/covax/.well-known/jwks.json:
$ sha256sum jwks.json
cf70c7a7405ebbdc99034bb2304c8b19efbb009e759665f620498a9aa00f5b79  jwks.json]
Verified by disassembling Alberta's verifier Android app [1], as Alberta
has yet to publish its key to the location specified in the standard.
Additional thanks to /u/YegThrowawayWasTaken on Reddit.

[1] https://play.google.com/store/apps/details?id=ca.ab.gov.covidrecordsverifier
Key from https://pvc.novascotia.ca/issuer/.well-known/jwks.json:

$ sha256sum jwks.json
8c78b49846b9f86e66b56c6d3a756c08e4a6bce8ff555f3b6dd7039e49847cc0  jwks.json

(Found via the-commons-project/vci-directory#185.)
Utah outsources Covid-19 digital vaccine records to Docket [1].

Key from https://docket.care/ut/.well-known/jwks.json:

$ sha256sum jwks.json
15babf40deb6ecd73c9cdf252324eaef34bd042dfafb89dcbbba52dea303b708  jwks.json

(Found via the-commons-project/vci-directory#191.)

[1] https://immunize.utah.gov/usiis/usiis-parents-individuals/
New Jersey outsources Covid-19 digital vaccine records to Docket [1].

Key from https://docket.care/nj/.well-known/jwks.json:

$ sha256sum jwks.json
9705c17aa5a4ceac5493f69b4dc04e703955dc7b690e7534d66231d759179063  jwks.json

(Found via the-commons-project/vci-directory#191.)

[1] https://covid19.nj.gov/faqs/nj-information/slowing-the-spread/consumer-access-to-covid-19-immunization-records-with-docket-faqs
Key from https://immunizationcard.manitoba.ca/api/national/.well-known/jwks.json:

$ sha256sum jwks.json
0a6388ba092f9aa8460769d170157a4af4c5f80e70166c92a005131522a67335  jwks.json

(Found via the-commons-project/vci-directory#192.)
Key from https://prd.pkey.dhdp.ontariohealth.ca/.well-known/jwks.json:

$ sha256sum jwks.json
a9411fca67636f80260d805b2468980a62f2c309cfcf4e5e9386fdc23a94b2e2  jwks.json

(Found via billylo1/covidpass@bd2ec1a;
with thanks to the grassroots vaccine pass team (@grassroots_team on
Twitter)).
…ion records

The Cayman Islands appears to use Cerner's electronic medical records
system for all health records, including Covid-19 vaccine records [1].

Key from https://fhir-myrecord.cerner.com/r4/QGFlV8qKdgYu-vPpMAoQW5U4Jb7riiI2/.well-known/jwks.json:

$ sha256sum jwks.json
276845f41ed6cda6c224350649c46fbb22346325f9e53ff183987236bc68dd96  jwks.json

[1] https://www.hsa.ky/our-services/patient-portal-info/
@steven676 steven676 changed the title Add support for CA/NY/LA/VA/HI/YT/BC/SK vaccine records, other changes Add support for CA/NY/LA/VA/HI/UT/NJ/YT/BC/SK/AB/NT/NS/MB/ON/Cayman Islands vaccine records, other changes Oct 16, 2021
Minnesota outsources Covid-19 digital vaccine records to Docket [1].

Key from https://docket.care/mn/.well-known/jwks.json:

$ sha256sum jwks.json
d8b09156d15628dfdf411cdba45671b33bd3151eb889aafe0e720919408db44e  jwks.json

[1] https://www.health.state.mn.us/people/immunize/miic/records.html
@steven676
Copy link
Author

steven676 commented Oct 16, 2021

More signing keys:

  • Canadian provinces and territories: Alberta (thanks @peacey, closes Government of Ab recognized as fake  #16), Northwest Territories (thanks @lpgca), Nova Scotia, Manitoba, Ontario
  • US states: Utah, New Jersey, Minnesota (all of which outsource to Docket; it's unclear to me whether they're actually issuing SHCs yet, but the NJ/UT submissions to the Commons Project VCI Directory suggest it's coming)
  • Cayman Islands Health Services Authority (Cerner user)

@steven676 steven676 changed the title Add support for CA/NY/LA/VA/HI/UT/NJ/YT/BC/SK/AB/NT/NS/MB/ON/Cayman Islands vaccine records, other changes Add support for CA/NY/LA/VA/HI/UT/NJ/MN/YT/BC/SK/AB/NT/NS/MB/ON/Cayman Islands vaccine records, other changes Oct 16, 2021
…cord

Key from https://www.gov.nl.ca/covid-19/life-during-covid-19/vaccination-record/prod/.well-known/jwks.json:

$ sha256sum jwks.json
66684693005b6f45a1443b53322677e5c385727487f46ebae6a642e3244d1b28  jwks.json

With thanks to GitHub user @craftxbox; closes fproulx#17.
@steven676 steven676 changed the title Add support for CA/NY/LA/VA/HI/UT/NJ/MN/YT/BC/SK/AB/NT/NS/MB/ON/Cayman Islands vaccine records, other changes Add support for CA/NY/LA/VA/HI/UT/NJ/MN/YT/BC/SK/AB/NT/NS/MB/ON/NL/Cayman Islands vaccine records, other changes Oct 17, 2021
@ShrimpWink
Copy link

Hey Awesome code,

Works great for my vaccine.
Not that i want to know them or get in trouble but i heard private keys are readily available out there. Is that true ?
I have just heard people now generating QR codes

@dlh3
Copy link

dlh3 commented Oct 20, 2021

@ShrimpWink if private keys for trusted passport issuers have leaked, that's concerning and certainly undermines the entire system. If you know of specific governments/organizations that have had their private key leaked, I would encourage you to notify them, as it means they should stop accepting passports signed with the leaked key and re-issue new ones.

It would also be worth reporting to VCI Commons (https://github.com/the-commons-project/vci-directory) so they can remove those governments/organizations from the trusted issuers list until they re-issue passports signed with a new key.

@ShrimpWink
Copy link

ShrimpWink commented Oct 20, 2021 via email

Delaware appears to use Envision Technology's WebIZ platform [1] for
tracking immunization records.

Key from https://smarthealthcard.iisregistry.net/delaware/issuer/.well-known/jwks.json:

$ sha256sum jwks.json
1f3e96e5a653a0c7ef5c33b3a6f85282ce2605516bb9db9569e8c48e8d830857  jwks.json

(Found via the-commons-project/vci-directory#215.)

[1] https://envisiontechnology.com/products/
Connecticut appears to use Envision Technology's WebIZ platform [1] for
tracking immunization records.

Key from https://smarthealthcard.iisregistry.net/connecticut/issuer/.well-known/jwks.json:

$ sha256sum jwks.json
4120c091b645e921943b9cf95285797741e60ae003d0df710fbfa7d861e59a7c  jwks.json

(Found via the-commons-project/vci-directory#222.)

[1] https://envisiontechnology.com/products/
Nevada appears to use Envision Technology's WebIZ platform [1] for
tracking immunization records.

Key from https://smarthealthcard.iisregistry.net/nevada/issuer/.well-known/jwks.json:

$ sha256sum jwks.json
2f503c6a35c59e8426d202a4be136b60f89f00a733b2a976ba548711f964999c  jwks.json

(Found via the-commons-project/vci-directory#226.)

[1] https://envisiontechnology.com/products/
New Mexico appears to use Envision Technology's WebIZ platform [1] for
tracking immunization records.

Key from https://smarthealthcard.iisregistry.net/newmexico/issuer/.well-known/jwks.json:

$ sha256sum jwks.json
29a5fa3373b91bc5154c8939813da6fae3b4ce7ab795e83b0e0b523b882062d0  jwks.json

(Found via the-commons-project/vci-directory#227.)

[1] https://envisiontechnology.com/products/
…SIIS) records

Oklahoma appears to use Envision Technology's WebIZ platform [1] for
tracking immunization records.

Key from https://smarthealthcard.iisregistry.net/oklahoma/issuer/.well-known/jwks.json:

$ sha256sum jwks.json
6e842d2d805b90ec9211594f502f01217c2ddbefc61f9d15056e5043c594e600  jwks.json

(Found via the-commons-project/vci-directory#228.)

[1] https://envisiontechnology.com/products/
The Northern Mariana Islands appear to use Envision Technology's WebIZ
platform [1] for tracking immunization records.

Key from https://smarthealthcard.iisregistry.net/cnmi/issuer/.well-known/jwks.json:

$ sha256sum jwks.json
9e701b6b4703ed83b36541c51e4317d04e50f3b1ad82344feb907ad6e30ea193  jwks.json

(Found via the-commons-project/vci-directory#229.)

[1] https://envisiontechnology.com/products/
Guam appears to use Envision Technology's WebIZ platform [1] for
tracking immunization records.

Key from https://smarthealthcard.iisregistry.net/guam/issuer/.well-known/jwks.json:

$ sha256sum jwks.json
225040d69245b29d19ffb762184ce9ac592450042d962252cb810b95827598f4  jwks.json

(Found via the-commons-project/vci-directory#230.)

[1] https://envisiontechnology.com/products/
Kentucky appears to use Envision Technology's WebIZ platform [1] for
tracking immunization records.

Keys from https://smarthealthcard.iisregistry.net/kentucky/issuer/.well-known/jwks.json:

$ sha256sum jwks.json
7be3f7da7e3b309d238a75c68cad8a4b9c4c835dcdcb56ad5f8624c14dc67e0b  jwks.json

(Found via the-commons-project/vci-directory#231.)

[1] https://envisiontechnology.com/products/
…ion record

Keys from https://pvcprod.gov.pe.ca/.well-known/jwks.json:

$ sha256sum jwks.json
67ebfe49451fc583c9c92bf9f75d480df5e63a1530a6b88009632c5809732e13  jwks.json

(Found via billylo1/covidpass@901c61d;
with thanks to the grassroots vaccine pass team (@grassroots_team on
Twitter)).
@steven676
Copy link
Author

More signing keys:

  • US states and territories: Delaware, Connecticut, Nevada, New Mexico, Oklahoma, Kentucky, Guam, the Northern Mariana Islands (all users of Envision's WebIZ system; as with the Docket users, it's unclear how many are currently issuing SHCs, but the submissions to the VCI directory suggest they're coming)
  • Canadian provinces: Newfoundland and Labrador (thanks @craftxbox, closes NlVaxPass codes recognized as fake. #17), Prince Edward Island

@steven676 steven676 changed the title Add support for CA/NY/LA/VA/HI/UT/NJ/MN/YT/BC/SK/AB/NT/NS/MB/ON/NL/Cayman Islands vaccine records, other changes Add support for CA/NY/LA/VA/HI/UT/NJ/MN/DE/CT/NV/NM/OK/KY/GU/MP/YT/BC/SK/AB/NT/NS/MB/ON/NL/PE/Cayman Islands vaccine records, other changes Oct 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

System believes CA State SHC cards are fake
8 participants