Skip to content

e2ee: encrypt group messages with the group key's spec version - #275

Merged
iFixRobots merged 1 commit into
mainfrom
iFixRobots/line-group-key-spec-version
Oct 25, 2026
Merged

iFixRobots merged 1 commit into
mainfrom
iFixRobots/line-group-key-spec-version

Conversation

@iFixRobots

Copy link
Copy Markdown
Contributor

In some LINE groups and multi-person chats, every text sent from the bridge fails:

Failed to handle Matrix message  error="API error 400: {"code":10051,"message":"RESPONSE_ERROR","data":{"name":"TalkException","message":"TalkException","code":82,"reason":"specVersion does not match","parameterMap":null}}"

Code 82 is E2EE_RETRY_ENCRYPT. LINE keeps a Letter Sealing spec version on each chat's group key (specVersion in getLastE2EEGroupSharedKey). The LINE Chrome extension (3.7.2) reads it in unwrapGroupKey, encrypts with V1 when it is 1 and sends e2eeVersion set to that value. We already parse SpecVersion but never used it: group messages were always V2 with e2eeVersion: "2".

This stores the latest group key's spec version, encrypts V1 when it is 1, and sets e2eeVersion from the chunks we actually send. That also fixes the existing V2 → V1 fallback, which sent V1 chunks labelled as version 2. Fetched group shared key now logs spec_version.

Over the last 7 weeks, 14 chats for 13 users hit this, and no text was ever sent successfully in any of them. Reactions and plain-flow images in the same chats went through.

Before / after

Not run. It needs a chat whose group key is spec version 1, and I don't have one on a test account. Once deployed, spec_version in the logs and the next send in an affected chat will confirm it.

go build and go vet pass.

View in Indent
Tag @indent to continue the conversation here.

LINE stores a Letter Sealing spec version on each chat's group key.
When it is 1, LINE rejects V2 messages with TalkException 82
"specVersion does not match". Encrypt V1 for those chats, as the
LINE Chrome extension does, and set e2eeVersion from the chunks we
actually send.
@indent

indent Bot commented Oct 23, 2026 •

Copy link
Copy Markdown

Issues

No issues found.

CI Checks

All CI checks passed on e39baa8.

Review agents

Select any unchecked box below to run or rerun that agent.

Passed (1)
  • Indent Review Agent · No bugs found in the spec-version change.
Full results

Indent Review Agent

  • Summary: No bugs found in the spec-version change.
  • Last ran on commit: e39baa81
  • Latest result
    {
      "summary": "No bugs found in the spec-version change.",
      "findings": []
    }

@iFixRobots
iFixRobots requested a review from highesttt October 25, 2026 00:19
@iFixRobots
iFixRobots merged commit c5a432d into main Oct 25, 2026
9 checks passed
@iFixRobots
iFixRobots deleted the iFixRobots/line-group-key-spec-version branch October 25, 2026 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants