QR Code Security
QR stands for Quick Response. QR codes are square barcodes, also known as two-dimensional barcodes, that were first developed and used in Japan.
Like any other barcode, a QR code is simply a way of storing information in a machine-readable optical label. The data contained in a QR code can include plain text, email addresses, telephone numbers and other information.
QR codes store data using patterns of black dots and white spaces arranged in a grid. An imaging device, such as a camera or scanner, can scan these patterns and translate them into information people can read. Today, the most common way to scan QR codes is with a smartphone camera and a dedicated reader application.
QR codes are easy to generate and use. They offer a convenient way to store different types of data in a small space. If the data consists only of alphanumeric characters, a single QR code can hold up to 4,000 characters.
Because they can store different types of information, QR codes serve many purposes. Common examples include:
- Plain text: welcome messages at conferences.
- Addresses: home or business addresses.
- Telephone numbers: personal or business numbers.
- Email addresses: personal or business accounts.
- URLs: addresses of websites or specific web pages.
- Links to applications: apps available in stores such as Google Play or the App Store.
- Payments: QR codes can store information about a bank account or credit card.
- Online account authentication: websites can display a QR code that a registered user scans with a smartphone to log in automatically.
- Wi-Fi authentication: QR codes can store network authentication details such as the SSID, password and encryption type. Scanning the code with a smartphone can allow the user to join the network automatically.
- Product traceability in transport and logistics.
- Access to transport services, such as buses and flights; leisure venues and events, such as concerts, museums and exhibitions; or areas reserved for certain customers, such as VIP lounges.
- In some regions, QR codes are also widely used in funeral services, with codes on gravestones providing information about the deceased.
How QR Codes Work
A QR code essentially works in the same way as a conventional barcode. It is a machine-scannable image that can be read instantly using a smartphone camera.
Each QR code consists of a series of black squares and dots representing specific data. When a smartphone scans the code, it translates that information into something people can easily understand.
Put simply, a QR code contains encoded data. This data can be alphanumeric, numeric, binary or Kanji, the Chinese characters used in the modern Japanese writing system.
Beyond the technical explanation, a particularly important feature is how quickly QR codes can be scanned, with just the tap of a button on an ordinary smartphone. This makes them useful for marketers and businesses as a simple, fast way to provide instant access to stored information.
Many online QR code generators are available, making the creation process extremely simple.
To create a QR code, users only need to open an online generator and enter the text, URL, telephone number or other information they want the code to display. Colours, graphics and other features can also be edited to create a distinctive design.
The easiest and most common way to scan QR codes is with a smartphone and a scanning application. Usually, the user simply points the camera at the code, and the application decodes it.
Security Risks
QR codes are small patterns printed on a surface, intended to help transfer data from a physical medium to a digital one. They cannot easily be read with the naked eye, which makes them particularly difficult to alter after publication. However, there are several ways in which QR codes can pose a significant risk.
Criminals can introduce malware onto the smartphone used to scan a QR code. This direct approach only requires an unsuspecting user to scan a code leading to an infected website. Simply visiting that website can trigger a malicious download.
Malicious code injection involves the forced download of malware when a user visits a website after scanning a QR code. The downloaded code is designed to exploit software vulnerabilities in the device, including its operating system and browser. It can perform various malicious actions, such as joining a botnet to launch a distributed denial-of-service (DDoS) attack against a legitimate website, leaking confidential information, subscribing to services, silently viewing advertisements, gaining access to components such as the microphone or camera, accessing browser data or sending emails. These actions take place in the background, leaving users unaware of what is happening.
Phishing is another type of attack. Using a QR code, an attacker directs a victim to a compromised website to steal credentials or gain access to private information. Phishing websites can be difficult to identify because their URLs resemble those of trusted websites.
One approach is to change the domain extension, for example from “.org” to “.com”. Another is to make a small spelling change in the URL. Just one such alteration can allow an attacker to deceive a user with a web address that looks very similar to the original.
Once the user visits the phishing site, they are asked to enter their credentials. The attacker can then access their accounts, make changes, view private information and cause irreversible harm to the organisation or individual.
QRLjacking, or session hijacking, is another type of attack. It uses social engineering to hijack an account on a service that supports QR code login.
The attacker attempts to trick the victim into scanning a modified QR code that replaces the original code previously captured by cybercriminals. When the victim scans it, the attacker captures the victim’s session credentials and covertly accesses the information in the account.
Cybercriminals can also publish QR code generation tools online that redirect users to a different URL from the one requested.
Other methods include printing a QR code on an adhesive label and placing it over a legitimate printed code, or emailing a malicious QR code to an unsuspecting user.
There is also the risk that an attacker could discover a flaw in a smartphone QR code reader application that allows them to exploit the camera and sensors of the phone or another device.
The malicious use of QR codes relies heavily on people’s natural curiosity and the temptation to scan a code simply to see what it contains. Many people do not stop to consider that this action could have serious cybersecurity consequences.
Tips and Recommendations
Recommendations and good practices for avoiding attacks involving QR codes include:
- Regularly check that QR codes used in business or personal activities have not been replaced or modified by third parties.
- Choose a QR code generator or service that provides adequate security assurances regarding code generation, correct links to services and accurate information, among other considerations.
- Check that the QR code redirects to the stated page or service. Use a reader application that lets you inspect the URL before opening it.
- Disable the automatic opening of links when scanning a QR code. This allows you to check the destination address and open it only after explicitly approving access.
- Check that the URL belongs to a trusted website and matches the address shown on the menu, leaflet or advertisement.
- For QR codes that provide access to transport services, leisure activities or restricted areas, do not share or use them through social media, as this could expose you to fraud.
Businesses should also use a mobile threat defence solution that can protect against phishing attempts, man-in-the-middle attacks and malicious application downloads that may result from scanning QR codes.
Finally, users need training and education in technology and cybersecurity. Informing them about the potential dangers of scanning QR codes and raising their awareness is essential to corporate security, which is only as strong as its weakest and least prepared link.