An unofficial, read-only Hacker News reader.

Models Can Communicate via Inference Servers Despite Being Sandboxed (opens external site)

468 points by gmays 4 days ago | www.lesswrong.com | 218 comments on HN

View full thread · View on Hacker News

Comment thread (13)

  1. The web uses globally shared caches absolutely everywhere, it is extremely dependent on them in fact. How do you think CDNs work? Do you think they keep different caches for different users?

    The fact that browsers don't cache data cross-origin is a completely different side of this. The server-side prefix cache used in inference servers is much more similar to a CDN cache, where content cached from userA's request is served to userB if their requests match.

    Replies (4)
    1. > The server-side prefix cache used in inference servers is much more similar to a CDN cache, where content cached from userA's request is served to userB if their requests match.

      But how often does that happen? Is there any advantage to sharing the cache in this way?

      Whenever i ask an LLM about something, i don’t think anyone else is likely to have asked the same thing phrased the same way recently enough that even if it was previously in cache it won’t already have been evicted by the time i ask.

      Replies (1)
      1. It happens quite often for the system prompt and other fixed prompts sent by agents/harnesses. ClaudeCode for example has about 42000 tokens it uses from the start of every conversation, much of which is identical between any two ClaudeCode systems in general, with another portion being shared by any two runs from your own system, even if otherwise entirely unrelated.

        It's also likely that many sub-agent calls to run a web search and summarize results can be entirely shared between different agents on unrelated systems if they're analyzing and summarizing the same web page (e.g. reading well known standards to summarize them).

    2. Agents use the global caches to change behaviour. We can think of it as prompt injection with extra steps.

      Browsers do not do that. Or am I misunderstanding?

      Replies (2)
      1. Browsers do that too: when you are the first person to retrieve a JS library stored by a CDN from your area, you will wait, say, 2s until it loads, and you'll get some headers indicating that this item was retrieved exactly when you requested it. When another user's browser requests the same JS lib from the same CDN from the same area, they will get the result in, say, 500ms, and the headers will indicate it was retrieved, say, 2 minutes ago.

        Two browsers that are the only two clients of the same local cache of a CDN can use this sort of thing to communicate with each other.

        What browsers don't allow is a similar collusion between two different servers that different tabs have accessed. Server 1 can't use your local browser cache to communicate covertly with Server 2, since the browser keeps entirely different caches even when loading the exact same content from either origin.

      2. The key difference is that the agents must be specifically trained to look for these side channels, and that training requires knowing fairly exacting details of the serving infrastructure. So it requires both prompt injection and an infected model targeting the exact infrastructure.

        The assertion that frontier models can figure this out without being trained to look for it is, IMHO, without merit. The demonstration of a larger model figuring this out without being trained was done by giving the larger model access to raw logit values. Logit values carry way more information than tokens, and are NEVER exposed to a model directly as input in any serving system or circumstance, partly because they take way more bits of data. All this stuff is done by exploiting tiny rounding differences in the last digits of the floating point values, which models under normal circumstances physically cannot pay attention to.

    3. Maybe I’m slow to catch on, but this seems like something you could exploit in a timing side-channel attack, similar to Spectre, to exfiltrate other clients’ submitted prompts? Not that those are likely to be very interesting, but still…

      Edit: Exfiltrate, not exfoliate, lol.

      Replies (1)
      1. Exfiltration is trivial in some sense (the server tells you if and/or how much of the prompt you send was new vs retrieved from cache). The major catch is that you have to guess the exact prefix, and only then the server will tell you if your guess was correct or not. So this doesn't really give you a way to discover information you didn't know, only to discover if anyone else has had the exact same question.
        Replies (2)
        1. Until you stumble across an app that always sends the exact same prefix up to “user’s date of birth is:” or similar, and now you can do a little enumeration to get private data out of the system.

          It’s OK to cache known safe prefixes across users, but arbitrary prefixes need to stay per-user.

          Replies (1)
          1. Caching is done by blocks of tokens where you need to match the whole token block exactly. You'd need to correctly guess an entire cached block ok tokens, and the next one. The next incomplete one might not be cached. This seems like a hard attack to pull off?
        2. You can start by guessing the prefix "A" and go from there. 26 tries later you know which of "An", "At", "Az", "Aq" etc. are in cache, and you can go from there. Eventually you'll discover that someone asked "Am I gregnant?" :P
    4. Web services don’t cache private info across users. Consider a file storage service. You might have the client hash the file before uploading and skip the upload if you already have a file with that hash. This is smart design if it’s being used as a sync service. You might make this happen systemwide, so if user A uploads a file and then B uploads the same file, B can skip the upload. This must not be done. Your service now becomes an oracle that tells you whether someone else using the service has uploaded a particular document. Find a document that gets filled out with name and date of birth, and if you know the name of someone using the service and they’ve uploaded a filled-out copy of this document, you can discover their date of birth.

      Put more concretely, it’s OK if Netflix caches across users (technically, someone can leak the data that someone in the metro area has recently watched Morbius, but the amount of data leaked is too small to matter) but not ok if Gmail does it.

      A KV cache shared across users is pretty dangerous and I’m surprised anyone does this, aside from some known fixed prefixes.

      Replies (1)
      1. In practice I think an upload like that is too contrived to worry about.

        Maybe exclude files under 10KB/100KB from cross-account skipping.