Roland Turner

about | contact

TraceTogether Token Teardown Time!

Summary

Singapore's Minister for Foreign Affairs and Minister-in-Charge of the Smart Nation Initiative — Vivian Balakrishnan — invited several makers and open-source advocates to a session with GovTech on Friday, during which a teardown of the first version of the TraceTogether token was performed. The purpose of the session included allowing us an opportunity to examine and learn about the token, and to propose improvements.

The need to protect the integrity of an in-progress limited tender process for the second batch of tokens meant that there were tight limits on what could be disclosed to us, so this post is very much an initial view. Even allowing for that, the opportunities to learn some things about the token, to advocate improvements, and to publish some details of what we learned were worthwhile. A hackathon to permit developing open firmware for the tokens is proposed after the tender closes on June 30; if that goes ahead then full technical details will need to be made public in which case I'll be able to expand on this post.

Some highlights:

Background

(This section is quite long. Feel free to jump to The teardown session if you're in a great hurry, but I have been finding it necessary to explain the background to people in detail in order for them to make sense of my view of the token. I encourage you to read the whole thing.)

Contact tracing

A pillar of communicable disease control is the tracing of a patient's contacts, so that both:

The contacts are usually identified by interviewing the patient about their movements during the period that they were likely to be infectious. This process is time-consuming, potentially stressful and — depending upon the nature of the disease and the patient's state of mind — likely to miss many relevant contacts.

Bluetooth proximity detection as a contact tracing aid

Where there are records available to help jog the patient's memory, their use is often helpful:

Interviewer: "OK, June 11. Did you leave your home at any time on that day?"

Patient: "I really can't recall."

Interviewer: "It looks as though you were near a large number of people between 20:10 and 22:45, does this ring any bells?"

Patient: "Oh, yes, I went to the cinema at {location} to see {film} with {list of friends}."

A team within GovTech realised that Bluetooth proximity detection implemented as a smartphone app could provide a useful tool to support this process, while maintaining strong privacy protections, so worked with Ministry of Health contact tracers to develop TraceTogether. In the example above, not only would it provide a prompt to jog the patient's memory, if epidemiological data indicated that sitting in a cinema containing an infectious person was a transmission risk then it would also provide the means to reach a large number of potentially exposed people whom the patient did not know. With or without TraceTogether, the contact tracer might also contact the cinema and seek contact information for other identifiable patrons who were seated nearby, or at list in the same room (those who paid by credit card, are part of a loyalty program, etc.), but those who paid cash for their tickets could not be identified this way.

There are two key points here:

In the meantime Singapore has developed the process still further, including getting the process from days down to hours, which materially reduces how much transmission an asymptomatic carrier can give rise to, backward-looking tracing (using antibody testing as the biological test, rather than PCR) to track all of a cluster, and proactive testing of contacts of contacts to further cut the time that asymptomatic carriers are infecting people.

Centralised vs. decentralised

One rather simplistic way to use smartphones to help contact tracers is to record location histories detected by the phone, and continually upload them to a health authority database. This is so obviously a bad idea that TraceTogether doesn't do it, but astonishingly, Norway's health authority did, and didn't shut it down until their privacy regulator told them to!

At the other extreme is a situation in which the series of random phone-generated temporary identifiers transmitted during a patient's infectious period are uploaded and published after testing positive, and then checked by each user's phone to see whether it received any of those and to alert its user to get tested if it did. This has the great benefit that a malicious actor in government simply can't use the system to learn anything about a patient's contacts, but it also means that the system can't be used to support contact tracers in performing their work, meaning that many more cases go undetected so infection spreads further and faster. This is approximately how Apple/Google's Exposure Notificaton (EN) works.

TraceTogether is something of a hybrid:

This has led to some commentators referring to TraceTogether as a centralised system. I'd suggest that a more precise description is that it's a mostly-decentralised hybrid which includes centralised report processing.

Technical problems

Neither Android nor iOS was designed with support for this sort of use in mind. By sheer happenstance, the app could be implemented efficiently on Android but not on iOS, because of the limits on Bluetooth access for apps running in a low power background mode on iOS. (I am not a mobile app developer, no doubt I don't have the specifics quite right, but that's the thrust of it.) The initial rollout of the app in Singapore therefore presented power and usability problems to iOS users, but still materially supported the contact tracing process.

Apple was approached and — skipping a few steps — jointly developed with Google an Exposure Notification capability that can be used solely by qualifying health authorities to develop efficient apps to help potentially exposed people discover the need to get tested. As I understand it, at the outset Apple was aiming to standardise contact tracing support, but somewhere along the way the approach shifted to one which simply enabled encouraging potentially exposed people to get tested without requiring that any information about people's contacts ever be exposed to government. If advising a potentially exposed person that they should get tested was the only important outcome of contact tracing then this might have been enough but, as above, this simply isn't true.

Given Apple's ongoing difficulties with governments demanding that it betray its customers by weakening its products (e.g. to make a compromised iOS to allow evidence to be extracted from phones without the owner's involvement), and the overlap of this idea with the usual technolibertarian fantasy of replacing all government with cryptographically-enabled technical systems, it is perhaps not a surprise that the idea took hold, but I suspect that the ultimate price for this will be a substantial loss of human life.

71% coverage

One of the problems with using Bluetooth proximity detection as a tool for inferring potential exposure is that its usefulness depends upon its level of adoption. A detection can only occur if both carrier and infected contact are both running the app, meaning that detection rate varies quadratically, i.e. with the square of coverage:

This means that 71% coverage represents an interesting milestone (assuming uncorrelated adoption), as it's the point at which more exposures will be detected than will not be detected, because 71% of 71% is about 50%, or √0.5 ~= 0.71. Consequently, adoption rates of about this figure (70%, 75%, 80%) are frequently adopted as nominal objectives. Sadly, when this gets said out loud to the public at large, it is frequently heard as "If we get to x% adoption then it will be useful, but less than that will not!", which is clearly incorrect. Instead it's just a curve which keeps getting better, faster as more and more people adopt.

Note also that the Pareto principle applies to almost all human endeavours: ~80% of the outcome tends to come from ~20% of the effort. This is only a rule of thumb, but often helps to think rationally about how to scope a project. As 71% is not far below 80%, this perhaps strengthens the tendency towards adopting numbers in this range as nominal objectives.

There are two other problems with treating this number as anything more than a nominal objective:

Inclusivity

Another very important problem with the app is that not everyone has a smartphone, or is at least not realistically able to carry and use one. This applies in particular to small children and to the elderly. I have attempted to teach a man in his 80s how to use a smartphone (my late father). It did not go well.

This gives rise to a failure of inclusivity. If you imagine, as many people appear to, that the sole purpose of TraceTogether is to get enough at-risk people tested to contain transmission then this might not seem like a big deal, particularly if you assume that some magic x% app adoption number means "job done!", however if you recall that the benefits of contact tracing include the opportunity to provide infection protection and/or treatment to an at-risk contact, then exclusion from this process is clearly a problem. For non-smartphone users whose Covid-19 risk is enormously raised merely by virtue of their being elderly, this exclusion — and the resulting delay in treatment — has the potential to be a matter of life and death.

The TraceTogether token and the outcry

Singapore has elected to address both the iOS problem and the inclusivity problem with the production and distribution of a token that can perform Bluetooth proximity detection to support contact tracing, and will be able to interoperate with the TraceTogether app.

On the face of it this is a fairly straightforward, uncontentious decision which addresses a real concern for a great many people. Unfortunately, the announcement of this decision gave rise to an unusually strong outcry, with tens of thousands of people signing petitions opposing it. This is not unprecedented, but it is rare. It is that outcry which gave rise to Rice Media approaching me for an interview ten days ago.

I suspect that there are multiple factors driving the outcry, but one of the most frequently cited is the concern that this is some kind of location tracking device, rather than merely the same sort of privacy-preserving contact-tracing aid as the app. I suspect that the simultaneous announcement of the requirement for the user to provide their national ID number upon registration, and mooting the possibly of mandatory use if conditions warranted it, might have compounded the problem.

The teardown session

Arrival

The session was held at a large GovTech meeting room at MapleTree (for those who know it: the room with a cafe/bar on level 10), naturally with tables very well spaced out. The invited makers and open-source advocates were Bunnie, Xobs, Harish, and myself. In addition to Minister Balakrishnan, there were perhaps 10-15 others around the room, several who presented or participated in discussion were introduced, the rest just observed.

Limits to transparency

Right from the beginning of the session it was clear that rather less was going to be disclosed than any of us had anticipated. I don't have the sense that there was anything disingenuous going on, just that the motivations for secrecy are strong. The approach therefore was to disclose what could be disclosed, to answer questions and discuss approaches, and to ask us to exercise some discretion. No formal NDAs were signed. No request was made to have GovTech vet our public disclosures (but see below about photos).

I observed three major limiting factors:

  1. There is a limited tender in progress for the second batch of tokens. The first batch — from which the tokens that we would take apart were drawn — was made by PCI, which is also one of the companies qualified to bid in the limited tender. It is reasonable to assume that PCI's proposed design for the second batch will share much with their design for the first batch, and as those aren't already in the hands of the public that design is therefore commercially sensitive information, the disclosure of which would unfairly affect the tendering process. Consequently, most of the chips had their part numbers masked and we were each asked to assert (verbally) that we weren't affiliated with any of the qualified bidders. There remains the possibility of aspects of chip shape/size/position and board layout giving away sensitive information, so we were asked to avoid publishing photos which were likely to have that effect and GovTech offered to vet photos for this purpose if we wished. I would prefer to avoid that entirely, so am not publishing close up photos at this point. I'd suggest that they're not that exciting anyway because of the masking and that the photos of each of us handling the boards will give a good sense of their size anyway. Similarly, we were advised that extracting the firmware was not OK.
  2. The security arrangements for the tokens (not merely the backend) are sensitive to disclosure. This is disappointing, but not overly surprising given the power limits that arise from the use of a non-rechargeable power source. We were also asked not to photograph the slides which were mostly Bluetooth protocol information from the limited call for tender. I infer that this was for the same reason.
  3. The entrenched cultural norms for an organisation that — like most — doesn't have much experience with making its technology open. I did not perceive a lack of co-operation because of this, just a lack of familiarity and comfort with being open about the innards of something that has a sensitive function.

Power source

The detail that stunned me was the power source. It's a large coin cell and is expected to run the token for 9 months! I neglected to make note of its part number, but it's something like a CR2477. I had not considered something like this possible, so had taken for granted a rechargeable battery. Not requiring recharging not only means no charger, but also that many users will be able to attach it to a key ring or a child's back pack etc. and then just forget about it. This level of ease of use is fantastic.

Note that at 3V and 1Ah, the cell's energy capacity is just 10.8kJ. For 9 months' operation, that's an average power draw of ~460uW. At this level power use must be not merely efficient, but downright miserly.

Protocol

An immediate consequence is that every possible measure has to be taken to reduce power drain, most importantly by the Bluetooth receiver. The power used by the transmitter can be minimised by keeping the messages short, but the receiver has to be on for at least a single digit percentage of the token's entire service life and will therefore dominate power consumption. Much less than this, and the risk that a relevant encounter won't be detected at all becomes significant.

A result of this is that a new protocol "BlueTrace Light" has been developed. It is connectionless, does not include the device model information or inter-jurisdictional support that BlueTrace provides, just tiny encrypted messages, presumably little more than the temporary IDs. Detailed protocol information was not provided. In particular, the method of generating temporary IDs for each 15 minutes was not discussed. It's conceivable that they're generated externally and loaded at manufacture: 9 months operation would require about 26,000 IDs.

Given the sensitivity about the details, quite how interoperation with the app is going to work is not clear. It is conceivable that BlueTrace Light will be included in TraceTogether, but not in the published OpenTrace source in order to keep the details from public view.

Components

There isn't all that much to tell. There's a SoC, 64 Mb (i.e. 8MB) of flash, a Bluetooth radio, an RTC and additional coin cell to keep the RTC operating while the main cell is replaced, a power regulator, some option resistors, a couple of LEDs, (presumably) JTAG pads, ... Take away just about anything and the token wouldn't be able to do its job.

Certainly there weren't any obviously inappropriate things like e.g. a GPS receiver. Indeed, the power budget means that using GPS would be impossible anyway.

I would very much like to have known the part numbers of the SoC and Bluetooth radio as any open firmware plans hinge critically on those, but until the limited tender closes we're not to know.

Security

The perfect as the enemy of the good

I had a discussion with one of the GovTech representatives a few days prior to the session, during which I learned that disclosures about security arrangements would be very limited. I expressed concern, particularly the cryptography 101 argument about only the key being secret and that the rest of the mechanism should be robust even if disclosed, thereby enabling it to benefit from improvements gained through widespread scrutiny. He acknowledged the importance of this, but pointed out that the benefit to be obtained by spending a few more weeks exploring marginal security improvements to, maybe, get to a mechanism which could be disclosed would likely be worth far less than the cost of that delay. Given that Covid-19-related government expenditure and economic contraction are in the hundreds of millions of dollars per day at present, I can see his point. Important consequences include the likelihood of the loss of a couple of my wishlist items, including that the complete firmware source code probably can't be published and that individual users can't extract the firmware from their token to independently examine it.

This is one of the more uncomfortable facts arising from the session. Putting my CISO hat on: it is something that risk managers — whether in information security, insurance, industrial plant safety, or almost any other field — deal with on a daily basis, but is often not visible to the public at large. Yes, we'd like to take our time and get everything right, but in a rapidly evolving situation time may be an unaffordable luxury. This is not an excuse for abandoning discipline and accepting unbounded risk, on the contrary it argues for more diligently managing the risk within the constraints of the situation, just that it's necessary to accept some residual discomfort.

This is sometimes expressed as not allowing the perfect to be the enemy of the good: accept the good and move forward rather than holding out indefinitely for the perfect.

Consequences of low-power operation

A fundamental problem is that the power budget is so tight that asymmetric cryptographic operations will likely be impossible. If that assumption is correct, then the use of a system-wide shared AES key might be unavoidable, which in turn means that a sensitive secret is literally in any adversary's hands. Even if not, it's difficult to imagine how various DoS scenarios might be resisted without using asymmetric cryptography to issue and validate certificates, etc. Both of these point to a need for some amount of security by obscurity. This is something that is generally worth avoiding if at all possible, but it's also true that situations do arise where this is either the only option, or is the only option for many of the relevant controls. The infosec guy was not able to speak about any of the detail, but did point out that there was no one protective mechanism, instead there were multiple layers providing cumulative protection:

DoS/DDoS

The risk from adversaries that seemed to be of most concern was DoS, so much so that one of the GovTech representatives said to me words to the effect that if I could come up with a means to protect the tokens against DoS which would remain robust if it were publicly disclosed, then he'd use it. The implication appeared to me to be that their rather large infosec team had already concluded that this is not possible.

Nonetheless, in either case it's desirable that the system be able to continue to function largely correctly in the face of such an attack and/or to recover correct operation promptly. As the mechanisms that I'm accustomed to using to fend off DDoS on the Internet require substantial processing and storage resources, I can readily see the difficulty in doing this well on the token, and therefore the reliance on secrecy.

Tracking individuals

While the difficult problem for GovTech appears to be adversaries preventing the system from working at all, the great concern for the rest of us is the potential for the misuse of the tokens to track our daily movements, other than for contact tracing if we test positive.

I'd suggest that this is much simpler to resolve than the DoS concerns:

Token security vs. app security

Many of the same concerns arise for the app, but there's an important difference: security is not just about preventing breaches, it's also about recovering from them, promptly. If an unacceptable breach is detected, a recovery option for the app is to roll out a fix immediately. The same isn't true for the token, meaning that a lot more up front protection is required.

Is use of the token OK?

Yes.

It fills really important gaps in the ability of the MoH to keep the virus contained and therefore to facilitate a return to sustainable economic activity while the epidemic continues, if not quite to pre-epidemic levels. In particular, it allows for stronger protection to be extended to many of those who are most vulnerable to Covid-19, but for whom smartphones are a non-starter.

It's unlikely to be a useful tracking device, even if a large number of malicious actors in government conspire.

The security disclosures are nowhere near as thorough as I would wish, and I remain hopeful that there will be some progress on this, but this does not seem to me to be a showstopper.

Next steps

Hackathon

It's not quite clear what form this will take, particularly because the starting point looks like being a token with no firmware, but the only obvious impediment to this going ahead is the need for secrecy around the limited tender, which suggests that a July date may be possible.

Importantly, preparation for this will require public disclosure of the component part numbers, which will allow filling of some of the gaps above.

Data protection impact assessment.

A really important tool for fostering trust is the publication of detailed impact assessments. Performing such assessments will become mandatory for private sector processing on the legitimate interests basis if the proposed changes to the PDPA are adopted by Parliament. Voluntarily performing an assessment on the TraceTogether app and token and then publishing it would seem to be a particularly good opportunity for government to model the new behaviour expected of private sector organisations.

I mentioned the COVIDSafe Privacy Impact Assessment above; this is the analogous document in Australian conditions. That level of transparency on TraceTogether would have helped me give a number of people clearer, fact-based reassuring answers to questions that were concerning them, rather than my educated guesswork. My guesswork is pretty good, but factual disclosures are better.

It appears that such an assessment was performed for the app. I proposed to a number of people present at the session that updating this for the token, redacting any sensitive disclosures, and publishing it might be a worthwhile transparency measure. The reception was positive, with some luck it will actually happen.

Open firmware

On the face of it, the challenge to devise a protection mechanism that will work on this power budget even if it's publicly disclosed seems like a fool's errand, let alone that I can't see GovTech disclosing their threat modelling and risk acceptance criteria against which to evaluate proposed mechanisms. The power budget alone makes this analogous to sending soldiers onto a battle field armed with nothing but fists and swearing, blindfolded, and narcoleptic. Nonetheless, it is a tantalising question...

Some quick poking around turned up related work for automotive settings (e.g.). This suggests that it's not entirely impossible, but "experimental cryptography" vs. "security by obscurity" is unlikely to be a productive debate.

I will think about this.

See also

Updates

2020-06-22

2020-06-23