Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crypto: Duplicate message index after using the share extension #7376

Closed
thegcat opened this issue Feb 17, 2023 · 12 comments
Closed

Crypto: Duplicate message index after using the share extension #7376

thegcat opened this issue Feb 17, 2023 · 12 comments
Labels
O-Occasional Affects or can be seen by some users regularly or most users rarely S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect Something isn't working: bugs, crashes, hangs and other reported problems X-Cannot-Reproduce Requires reproducing X-Needs-Info This issue is blocked pending further information from the reporter

Comments

@thegcat
Copy link

thegcat commented Feb 17, 2023

Steps to reproduce

  1. Use Element iOS
  2. Go to another App
  3. Take a screenshot
  4. Post screenshot to Element iOS using the share sheet
  5. Write another message in the room the screenshot was posted to before anyone else could do anything (even the typing indicator from another user seems to remove this problem)

Outcome

What did you expect?

Being able to post a picture to a room using the iOS share sheet and then post a message that can be decrypted by other participants and my other devices in that chat.

What happened instead?

{
  "type": "m.room.message",
  "content": {
    "msgtype": "m.bad.encrypted",
    "body": "** Unable to decrypt: DecryptionError: Duplicate message index, possible replay attack: xxx **"
  }
}

Your phone model

iPhone 14 Pro

Operating system version

iOS 16.3.1

Application version

Element 1.10.2 (20230210134131)

Homeserver

{"server":{"name":"Synapse","version":"1.77.0"}}

Will you send logs?

No

@thegcat thegcat added the T-Defect Something isn't working: bugs, crashes, hangs and other reported problems label Feb 17, 2023
@thegcat
Copy link
Author

thegcat commented Feb 17, 2023

This is the same defect as #4104, not sure if this counts as a duplicate or not.

@Velin92
Copy link
Member

Velin92 commented Feb 28, 2023

Hi thanks for the report, let's keep this issue since you're report is also more descriptive.
Could you also provide a screen recording of the issue if possible?
Since I am not able to reproduce it.
Thanks.

@Velin92 Velin92 added X-Needs-Info This issue is blocked pending further information from the reporter X-Cannot-Reproduce Requires reproducing labels Feb 28, 2023
@Velin92 Velin92 added S-Major Severely degrades major functionality or product features, with no satisfactory workaround O-Occasional Affects or can be seen by some users regularly or most users rarely labels Feb 28, 2023
@thegcat
Copy link
Author

thegcat commented Feb 28, 2023

@thegcat
Copy link
Author

thegcat commented Feb 28, 2023

2fd39bf3-d5e6-4be4-812f-579149cb0b67

This is the view from someone else in the room on Element Desktop Linux (Element version: 1.11.23 Olm version: 3.2.12). This is also what I see on Element Desktop macOS (Version von Element: 1.11.23 Version von Olm: 3.2.12). Interestingly enough the other person can decrypt the message on Element Android.

@Velin92
Copy link
Member

Velin92 commented Feb 28, 2023

Uhm I am not having any troubles on El-iOS, and since it's handled correctly on El-Android too, this might actually be an El-Web issue.
Maybe would be better to report this issue to the El-Web repo (since the desktop versions is essentially the same as the web version) and link it here @thegcat

@Velin92
Copy link
Member

Velin92 commented Feb 28, 2023

https://github.com/vector-im/element-web @thegcat here is the repo

@thegcat
Copy link
Author

thegcat commented Feb 28, 2023

I thought this issue also existed between Element iOS, i.e. doing this on my iPhone would show the issue on my iPad, but I just checked this with the example I posted above and the message can be decrypted on the iPad.

@Velin92
Copy link
Member

Velin92 commented Feb 28, 2023

It's then very likely an el-web issue then closing this one here, but I suggest opening an issue there and linking this.
Thanks for the report!

@Velin92 Velin92 closed this as completed Feb 28, 2023
@thegcat
Copy link
Author

thegcat commented Feb 28, 2023

Uhm I am not having any troubles on El-iOS, and since it's handled correctly on El-Android too, this might actually be an El-Web issue.

I'm not quite sure this is only an element Web issue.

If I make a screenshot in element and send it via the share sheet while element iOS is still the currently running app behind the share sheet I cannot reproduce this issue. I.e. I would not say this is only an element Web issue, as the state of the element iOS is a factor.

@thegcat
Copy link
Author

thegcat commented Feb 28, 2023

It's then very likely an el-web issue then closing this one here, but I suggest opening an issue there and linking this.

See above, the state of element iOS is relevant to reproduce this bug, and I don't think it's an element Web only bug. I would go so far as suspect Web to work correctly and Android and iOS not checking this sort of decryption issues (re-using a message index), but I am not knowledgeable enough wrt the encryption to say which way it is.

As a side-note, I have to say that being sent around within the Element eco-system to bugs that seem to already have been opened, fixed, but still creep up, and then in effect setting a +1 on a bug that seems to be abandoned for 2 years, doesn't offer neither a unified nor a generally positive impression of the project. Presenting "Element" as a unified branding to users and then telling them to go to that other element thing might not be easily understable and an experience inviting more bug reports to average users.

@Velin92
Copy link
Member

Velin92 commented Feb 28, 2023

Hello again! @thegcat
If you check the "view souce" option of a message you can check the event id of the message itself, to see if the same index/same message identifiers are being used.
In trying to reproduce the issue I see that they have two different IDs so it's definitely not this issue.
Also i tried to reproduce the bug with other non element clients, and it does not happen.
As I said is very likely a El-Web issue.
Thanks.

@richvdh
Copy link
Member

richvdh commented Jun 21, 2023

@thegcat may be seeing #7499

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
O-Occasional Affects or can be seen by some users regularly or most users rarely S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect Something isn't working: bugs, crashes, hangs and other reported problems X-Cannot-Reproduce Requires reproducing X-Needs-Info This issue is blocked pending further information from the reporter
Projects
None yet
Development

No branches or pull requests

3 participants