Skip to content
This repository was archived by the owner on Jan 29, 2024. It is now read-only.

TLS certificate name check should depend on JID domain #113

Closed
ivucica opened this issue Feb 5, 2020 · 7 comments
Closed

TLS certificate name check should depend on JID domain #113

ivucica opened this issue Feb 5, 2020 · 7 comments
Labels

Comments

@ivucica
Copy link

ivucica commented Feb 5, 2020

Bevor you create a new issue:

- [x] I searched for similar issues and did not find one
- [x] I'm using the latest version available in the [Windows Store](https://www.microsoft.com/store/apps/9NW16X9JB5WV)

I'm submitting a...:

  • Bug report (I searched for similar issues and did not find one)

Current behavior:

There are some awesome TLS options that I haven't otherwise seen in other clients (presumably because #28). Thanks!

However, I hardcoded name somehostname.example.com in place of having the client do SRV lookup on example.com for [email protected].

I ended up with TLS cert not being accepted and having to turn hostname validation off.

I need to use somehostname.example.com as SRV lookup doesn't seem to work, possibly due to some IPs in the A or AAAA record not working? The client is stuck in the 'Unknown' state.

Expected behavior:

TLS cert should probably be accepted even if it's an HTTP cert issued for example.com, if that's the domainpart of the JID.

Minimal reproduction of the problem with instructions:

  1. Use a generic letsencrypt cert valid for example.com, www.example.com and name.example.com with Prosody.
  2. Use jid [email protected].
  3. Manually specify ipv4only.example.com as your hostname.
  4. Client refuses to connect despite cert being valid for example.com.

Environment:

App Version(s): 
v.X.Y.Z <!-- Which version of the App are you using (e.g. v.0.2.0) -->

Windows 10 Version Number: <!-- https://en.wikipedia.org/wiki/Windows_10_version_history -->
- [ ] 1809
- [ ] 1803
- [ ] 1709
- [ ] 1703
- [ ] 1607
- [ ] 1511
- [ ] 1507
- [ ] Insider Build (build number: )
- [x] Misc: 1909

Device form factor:
- [x] Desktop
- [ ] Mobile
- [ ] Xbox
- [ ] Surface Hub

Where did you got the APP from?
- [x] [Windows Store](https://www.microsoft.com/store/apps/9NW16X9JB5WV)
- [ ] Self-build, using a provided release source
- [ ] Self-build, repo cloned at [dd.mm.yyy] <!-- When did you clone the repo! -->
- [ ] Misc, got it from... <!-- Please tell us your source! -->

@ivucica ivucica changed the title TLS certificate name check should depend on domain TLS certificate name check should depend on JID domain Feb 5, 2020
@COM8
Copy link
Member

COM8 commented Feb 6, 2020

Hmm...
This is an interesting behaviour I did not expect to happen.
I will have a look at it.

Thanks for reporting!

@COM8 COM8 added the 🐛 Bug label Feb 6, 2020
@COM8
Copy link
Member

COM8 commented Feb 22, 2020

Would an option for enabling this behavior be sufficient, or should UWPX, as soon as validation with the hostname (e.g. ipv4only.example.com) try to validate the cert for the domain JID name (e.g. example.com)?

@COM8
Copy link
Member

COM8 commented Feb 22, 2020

@KingKili any thoughts, if this could be exploited somehow?

@COM8
Copy link
Member

COM8 commented Feb 22, 2020

@ivucica the wird thing is, UWPX should not get stuck in the connecting state...
Do you mind trying to connect again, while logging is set to DEBUG (Settings -> Misc -> Log-Level).

And then upload the resulting logs.zip file here.
Be aware that you might want to cover up sensible information in your logs, before uploading them.

@KingKili
Copy link
Collaborator

@KingKili any thoughts, if this could be exploited somehow?

I don't think so. I would even say that in most cases the certificate for jid domain should be the correct one.

@COM8 COM8 closed this as completed in eb0c672 Feb 27, 2020
@COM8
Copy link
Member

COM8 commented Feb 27, 2020

Cert. validation should be fixed and will be included in the next release.

@COM8
Copy link
Member

COM8 commented Feb 27, 2020

@ivucica feel free to reopen this/a new issue if you have logs for the other issue ;)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants