InnerWeb
Skip to main content

A stranger photographs a QR badge: scenario for security

A contractor leaves a badge on a desk in the break room, and someone nearby photographs it and scans the code with their own phone. This scenario walks through what that person sees in the browser and why they cannot tell whether the code is active, revoked or made up.

256 bits
length of the random badge token
Source: karta
4
components of the gate verdict
Source: karta

Starting situation at a production plant

Consider a mid-sized production plant. A contractor arrives for service work, the reception desk prints a label with a QR code, the contractor's name and the company name, and the contractor slides it into a clear sleeve. After a break the contractor leaves the badge on a desk in the break room. Next to it sits an employee of another company who, out of curiosity, takes a photo of the badge with a phone.

The security manager then asks two questions. First: can the photo alone be used to enter the site or to learn anything about the contractor beyond what is already printed? Second: can the person holding the photo check whether the code still works? Both answers follow from how the code is built, not from user discipline. This scenario does not describe a rollout at a specific client. It describes how the system behaves, as documented in the function specification.

What is stored in the QR code

The QR code encodes the address of the system instance in the form of a /q/ path and a token. The same address appears in the invitation e-mail and on the printed security label. The token has 64 hexadecimal characters, that is 256 bits, and is built from 32 random bytes produced by a cryptographic generator. It is not derived from a counter, a person number or a date, so it cannot be guessed from the code of a neighbouring badge.

The code contains no name, no national ID number, no access rights and no expiry date. Everything the system knows about the holder is kept on the server and linked to the token. The label looks neutral: the plant logo and a QR code with the first name and company, with no server name in the description. A passer-by sees only what is printed on paper.

  • the instance address and the /q/ path with the token,
  • a 64-character random token, 256 bits,
  • no personal data and no access rights in the code itself,
  • only the plant logo, first name and company on the label.

Elements of the QR badge token

Elements of the QR badge tokenBar chart: the token has 32 random bytes, 64 hexadecimal characters and 256 bits.0100200300characters or bitsHex characters: 64 characters or bits64Hex charactersBits: 256 characters or bits256BitsRandom bytes: 32 characters or bits32Random bytes
Source: Function documentation: security panel and QR gate control

What the person who scans the photo sees

The phone opens the public address, and the server does not check the token there. A valid code, a revoked code and an invented string of the right shape all lead to the same flow and the same redirect. The passer-by therefore cannot tell whether the badge on the desk is active or whether someone has replaced it.

This has a practical consequence for security: a scan from a stranger's phone does not identify the holder. The holder's data appears only where an authorised device scans the code, that is at the gate and on the training tablet. There, an unknown, revoked and invented code all end with the same message, "unknown code" (404), without echoing the scanned string. The security dashboard also does not receive the token in the API response, only derived facts: whether the person has an active badge and when it was printed.

What happens if the photo is shown to the gate scanner

A photo of an active badge held up to the gate scanner is recognised like the original, because the system does not distinguish a printout from its copy. That is why the decision made after the scan matters. The gate verdict has four components: no overdue training, no missing qualifications for dangerous work, a work permit in progress for today, and an active account. A person missing any one of them is refused, and every attempt, including a refusal, is recorded.

The second safeguard is the on-site status. A scan at the gate determines entry, exit or refusal based on the current verdict and that status. If the legitimate holder is already inside the plant and someone tries to enter with a copy, the attempt remains in the event history. It is worth telling the security team that refusals and unusual sequences of scans are material to investigate, not background noise.

How to close the scenario on the plant side

When a contractor reports that the badge was left unattended, reception revokes it and issues a new one. The system does not overwrite the old row: a new token is created and the old one stays in the history as revoked. The new badge triggers a new e-mail with a new code, and each person receives the e-mail with the code at most once, thanks to an atomic flag in the database.

For the security manager this gives three rules. A copy of the photo stops working the moment the badge is revoked. There is no need to replace every badge in the plant. Evidence of which token was valid on a given day stays in the history. The procedure is described in the guide on revoking a QR badge, and the good practice on screenshots of access passes covers how to think about sharing screenshots.

Checklist

Video

Frequently asked questions

Can personal data be read from a photo of the code?

No. The code contains the instance address and a random token. The holder's data sits on the server and appears only at the gate and on the training tablet, where authorised equipment scans.

Can a passer-by check whether the code still works?

No. The public address gives the same flow for a valid, revoked and invented code, so the activity of a badge stays invisible from outside.

What should be done if a contractor lost the badge?

Revoke it and issue a new one. The old token stays in the history as revoked, and the new code reaches the person in a new e-mail or on a printout from security.

Let's walk through this scenario at your gate

We will show during a demonstration what a passer-by's phone sees and what an authorised scanner sees. Book a conversation with the InnerWeb team.

Let's talk