This QR Code Leads To Two Websites, But How?

QR codes are designed with alignment and scaling features, not to mention checksums and significant redundancy. They have to be, because you’re taking photos of them with your potato-camera while moving, in the dark, and it’s on a curved sticker on a phone pole.  So it came as a complete surprise to us that [Christian Walther] succeeded in making an ambiguous QR code.

Nerd-sniped by [Guy Dupont], who made them using those lenticular lens overlays, [Christian] made a QR code that resolves to two websites depending on the angle at which it’s viewed. The trick is to identify the cells that are different between the two URLs, for instance, and split them in half vertically and horizontally: making them into a tiny checkerboard. It appears that some QR decoders sample in the center of each target square, and the center will be in one side or the other depending on the tilt of the QR code.

Figuring out the minimal-difference QR code encoding between two arbitrary URLs would make a neat programming exercise. How long before we see these in popular use, like back in the old days when embedding images was fresh? QR codes are fun!

Whether it works is probably phone- and/or algorithm-dependent, so try this out, and let us know in the comments if they work for you.

Thanks [Lacey] for the tip!

 

44 thoughts on “This QR Code Leads To Two Websites, But How?

  1. Kind of a neat concept, but in my testing with three different apps I either simply had trouble reading the QR code or I got the Github link like 90% of the time. It wasn’t like it was roughly 50%. Seems like that’s most people’s experience from the Twitter page.

    1. It shouldn’t be 50/50, there’s apparently 2 angles, one of which should reliably give one link, the other of which should reliably given the other, if using a QR code reader exhibiting the described behaviour (reading the centre of each point, which due to perspective can be manipulated by angle). Of note, for using multiple apps, something to consider is that a lot of apps just put their own overlay on the built in device functions, it wouldn’t surprise me if Android and iOS apps frequently deferred to the built in QR code reader in the main camera app these days instead of bringing their own

  2. Yeah, works for me– depending on the angle, distance, lighting, humidity(?), it seems to go nearly evenly between a github page and a mastodon.social page. The QR equivalent of what color is the dress?

  3. I remain, utterly astonished that people blithely point their phones at compltely incomprehensible graphics and bllithely connect to them. Add now we have one that lets you get sent to either one of TWO malware/phish/ sites. Has NO one learned anything over the last 50 years of cybersecurity?

      1. Indeed, from one (stick-in-the-mud, enemy-of-fun) POV, this is another in the long line of Why We Can’t Have Nice Things technology quirks that’s potentially exploitable for nefarious purposes by bad actors.

        Like when it was revealed a while back that Unicode bidirectional text could be employed to scramble filenames in ways that hide their real file extension. (So that, for example, an unwary user doesn’t realize they’re launching an .exe file, because the .exe extension at the end of the name is located somewhere in the apparent middle of the name.)

        With clever application of text-direction markers, it’s theoretically possible for a name that looks like “This is an .execiting document.pdf” to actually be an .exe file. …That, and now this lenticular QR nonsense, is why we can’t have nice things.)

    1. Well, my iPhone gives me a preview of the link first (or actually just the server address), so I don’t have to connect at all to see it. If I would have had to connect to see the server or URL, I wouldn’t have tried it. Seems prudent enough when you know what you are doing.

      Ah well, I am using an iPhone. I won’t claim that it’s impossible to malware-infect an iPhone with an up-to-date iOS. But the possibility is quite unlikely.

        1. That, and zero days are valuable in the modern era of sandboxed and hardened browsing engines. It’s not impossible to zero day a browser and you shouldn’t go to suspicious links willy nilly, but the risk is much lower than it used to be because it’s much harder to break a browser, and even if an attacker finds a way to they aren’t going to waste it on low value targets and give security researchers a chance to investigate it

      1. Conversely, the camera app on my up-to-date iPhone (which I believe is the Apple-intended method of scanning QR codes) simply tells me that it recognized a link and gives me a button to follow it blindly. I have to use a third party app to actually show me the contents of the code instead of automatically following the link.

      1. That’s exactly the problem. We’ve absolutely failed, generally, to get users informed about technology. We just expect people to sit down and know. The problem becomes that the goalpost keeps moving further and further and further away, so it’s really just playing moron whack-a-mole. It’s already hard enough to get people to stop clicking attachments in e-mails, why would blindly scanning QR codes and opening the sites be any different?

        I hate this.

        1. What you expect if 80% of people would consider term URL as some dark magic? On other hand, education in schools is being reduced to religious indoctrination. Again. I guess, same people who is in charge of these scams, are also in charge of education.

    2. Re: Security.

      Check the link before you click through. Still, link obfuscation and link shorteners. That would be a huge warning sign, though.

      Do you trust the source of the QR code? I mean, Hackaday posted it, so it’s not intentionally malicious. (We can make mistakes, but so far in 20+ years we’ve never passed anyone on to malware sites, AFAIK.)

      But would I do the same with a random QR code off the street? About as fast as I’d re-use that needle I found in the back alley…

    3. Well yeah, it’s a known attack vector that people paste stickers of QR codes over the ‘official’ ones or even just create complete fake signs, menus etc.

      It’s a bit of a mystery to me why people aren’t more cyber aware but that’s the general public, gullible and easy to scam

    4. Clearly not. This is just more irresponsible crap being released without considering that, without fail, people will look at things like this as an obviously easy vector to launch attacks. The fact that I have to keep up with stupid crap like this just to protect my users annoys me to no end. I get that these guys think it’s “cool,” but what’s not cool is yet another way for dumb users to compromise my infrastructure.

    5. You can see what the URL is before connecting to it. All a QR code does is save some typing.

      The people who won’t look at the URL before connecting are the same ones that already click blindly on links, so nothing has changed at all.

    6. Honestly not that big of a deal if you follow basic cyber security rules. Don’t put in information on a page an unknown QR code sends you to (duh). Still leaves the zero-day risk, but that’s quite unlikely in general, even less likely given the source + browsers and OSes are quite good with heuristic checks now. This is a plausible but unlikely attack vector. (This got analyzed a lot after that super bowl commercial qr some years ago. The super consumer-y sources that just reprint whatever definitely framed it as a major risk. Cybersecurity sources had a much more nuanced view.)

    7. Pointing phone at some graphics shouldn’t be a security problem. It’s the existence of apps which will immediately open a url without showing it to the user and asking for confirmation which I don’t get. And they got all of the “verifications” and “approvals” and even come preinstalled… SMH

  4. I did try this and did manage to capture the 2 URLs with the “Barcode scanner” android app

    I managed to get both of them consistently by scanning from “the left” and then from “the right”, while the phone was in landscape orientation. Nice

  5. This reminds me of records that would play different things occasionally. Simple but brilliant: They just scribed two concentric grooves on the surface of the record. Depending on where you dropped the needle, it would fall into one or the other.

  6. I was able to capture both websites simultaneously by using Google lens on the source image. It automatically centers and captures the Mastodon link, but by making a searching box that has the code off in the top right corner of the searching field, it finds the GitHub page in the bottom bar while leaving the Mastodon link hovering above the QR code itself.

  7. I wonder if two QR codes with fewer differences between them would make this simpler or more reliable? Perhaps you could experiment with link shorteners, that way you could still send someone wherever you’d like but the qr code would look more “normal”

  8. The actual question should be “inventing something just for sake of inventing – do we still need more of the same?”

    Reason being, technology for the sake of technology is a larger topic nobody wants to touch with a stick while standing 100 yards/meters away. At the risk of being called an old fart, I fail to see the merits of this (ie, compressing two unrelated URLs into one QR Code).

    This is not the only thing that’s mostly pointless (IMHO), btw, just one out of thousands. Smart Watch that’s not exactly smart is another one (ie, it needs a bluetooth-connected cell phone to be smart). Prior to it was “semantic web” that largely failed without fanfare – though the promise was “smart web 2.0” as opposed to the “dumb web 1.0” which we seem to be stuck with regardless (“dumb web 1.0” is a general/blanket term, unrelated to anything suddenly AI-enhanced-again-for-no-clear-merit).

    If I am to go down this rabbit hole, I’ show the QR Code in three major colors RGB recognized universally by all browser engines as such … make some of them gradient so that one square can be interpreted differently depending on the QR Code being read … or better yet, four major colors, RGB and black, so each QR Code square can have four different colors … obviously, this is just to sctratch the scratch the surface …

    As a side note, as far as compressing anything goes, I have personal success stories of zipping ASCII texts, uuccping into ASCII and printing in a smallest font available (that can be realiably scanned) with zero margins on an acid-free A4 … the year was 2003 and it worked at 95% success rate using the cheapest technology available to me at the time (laser printer, tho, I needed text with no smudges). I stopped at that since mission was accomplished – I could readily archive plain vanilla ASCII text in reasonably large quantities (compared with anything better – like microfilms). I am pretty sure there are better faster more proprietary ways of doing that, but I am also pretty sure this is the bare minimum open source tech available to any average Sam, hence, it was a success.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.