# Discobot Certificate Issues \[title, public access, user id information leak\]

**URL:** https://meta.discourse.org/t/discobot-certificate-issues-title-public-access-user-id-information-leak/94177
**Category:** Bug
**Created:** [8월 8, 2018, 9:16오전 UTC](https://meta.discourse.org/t/discobot-certificate-issues-title-public-access-user-id-information-leak/94177 "2018-08-08T09:16:22Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![bkampmeyer](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@bkampmeyer](https://meta.discourse.org/u/bkampmeyer)
#### Post date: [8월 8, 2018, 9:16오전 UTC](https://meta.discourse.org/t/discobot-certificate-issues-title-public-access-user-id-information-leak/94177/1 "2018-08-08T09:16:22Z")

</div>

Hi everyone,

we just discovered three things while testing our new Discourse site with the certificate created by discobot after finishing the tutorial:

1. the html ‘title’ tag is “test\_cert”
2. the certificate can be accessed without beiing logged in to Discourse
3. the certificate is created dynamically by getting the user\_id within the URL. Using this anyone can go through all user\_id from 1 to \* and get info about all created users.

Especially the third point bothers us as we try to not publish any user info of users unless they post actively. This together with point 2 is big information leak..

Example:  
[https://meta.discourse.org/discobot/certificate.svg?date=Aug+08+2018&user\_id=43951](https://meta.discourse.org/discobot/certificate.svg?date=Aug+08+2018&user_id=43951)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [8월 8, 2018, 9:23오전 UTC](https://meta.discourse.org/t/discobot-certificate-issues-title-public-access-user-id-information-leak/94177/2 "2018-08-08T09:23:10Z")

</div>

Hmm any thoughts @tgxworld? We don’t want randos generating certs, so at minimum anons shouldn’t be able to do this.

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [8월 8, 2018, 9:34오전 UTC](https://meta.discourse.org/t/discobot-certificate-issues-title-public-access-user-id-information-leak/94177/4 "2018-08-08T09:34:46Z")

</div>

> [@codinghorror](#):
>
> We don’t want randos generating certs, so at minimum anons shouldn’t be able to do this.

I’ll fix this next week once I’m back from my short break 😁

> [@bkampmeyer](#):
>
> the certificate is created dynamically by getting the user\_id within the URL. Using this anyone can go through all user\_id from 1 to \* and get info about all created users.

@bkampmeyer Is your site a login only forum? The only info exposed by the SVG is the username and that could potentially allow them to access more public information via the `/u/<username>` route. However, I don’t see it as an information leak since the information is meant to be public.

---

<div class="post-metadata">

### Author: ![bkampmeyer](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@bkampmeyer](https://meta.discourse.org/u/bkampmeyer)
#### Post date: [8월 8, 2018, 9:45오전 UTC](https://meta.discourse.org/t/discobot-certificate-issues-title-public-access-user-id-information-leak/94177/5 "2018-08-08T09:45:38Z")

</div>

Hey Jeff and Alan,

thanks for your quick replies! Really appreciate that!

> [@tgxworld](#):
>
> Is your site a login only forum?

Nope, it’s not as we want it readable to everyone. However, we want to protect as much information as possible from our accounts which don’t post.

The latter is used by us to let people get mails when we publish News (by ‘watching’ the category).  
As it’s a special use case I’m not sure how many people will be troubled by this behaviour..

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [8월 8, 2018, 9:47오전 UTC](https://meta.discourse.org/t/discobot-certificate-issues-title-public-access-user-id-information-leak/94177/6 "2018-08-08T09:47:09Z")

</div>

I’m more worried about the ddos type effect if we let anons create the certs.

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [8월 8, 2018, 9:49오전 UTC](https://meta.discourse.org/t/discobot-certificate-issues-title-public-access-user-id-information-leak/94177/7 "2018-08-08T09:49:57Z")

</div>

> [@bkampmeyer](#):
>
> Nope, it’s not as we want it readable to everyone. However, we want to protect as much information as possible from our accounts which don’t post.

Hmm but if someone is going to write a script and loop through all the possible user ids, they can do the same with the `/u/<username>` route.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [8월 8, 2018, 9:51오전 UTC](https://meta.discourse.org/t/discobot-certificate-issues-title-public-access-user-id-information-leak/94177/8 "2018-08-08T09:51:12Z")

</div>

I can think of more expensive routes people could hit if they wanted to hurt us, generating the svg cert is super cheap

Also, you can get user lists more efficiently by going to directory which lists chunks of 30 or so to anon

I really see no urgency to change anything here

---

<div class="post-metadata">

### Author: ![bkampmeyer](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@bkampmeyer](https://meta.discourse.org/u/bkampmeyer)
#### Post date: [8월 8, 2018, 10:24오전 UTC](https://meta.discourse.org/t/discobot-certificate-issues-title-public-access-user-id-information-leak/94177/9 "2018-08-08T10:24:23Z")

</div>

> [@tgxworld](#):
>
> Hmm but if someone is going to write a script and loop through all the possible user ids, they can do the same with the `/u/<username>` route.

Of couse, but incrementing the user\_id is much more efficient than creating random usernames.

> [@sam](#):
>
> Also, you can get user lists more efficiently by going to directory which lists chunks of 30 or so to anon

Could you specify that? Which directory will list the users?

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [8월 8, 2018, 10:27오전 UTC](https://meta.discourse.org/t/discobot-certificate-issues-title-public-access-user-id-information-leak/94177/10 "2018-08-08T10:27:14Z")

</div>

[https://meta.discourse.org/u](https://meta.discourse.org/u)

You can also just crawl the forum and collect usernames, I am failing to see the drama or urgency here

---

<div class="post-metadata">

### Author: ![bkampmeyer](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@bkampmeyer](https://meta.discourse.org/u/bkampmeyer)
#### Post date: [8월 8, 2018, 10:40오전 UTC](https://meta.discourse.org/t/discobot-certificate-issues-title-public-access-user-id-information-leak/94177/11 "2018-08-08T10:40:06Z")

</div>

> [@sam](#):
>
> [Discourse Meta](https://meta.discourse.org/u)

The ‘/u’ doesn’t work if you disable the setting ‘enable user directory’.

> [@sam](#):
>
> You can also just crawl the forum and collect usernames, I am failing to see the drama or urgency here

No urgent drama from my side but if you try everything to hide users who don’t post on public categories this certificate behavior isn’t very pleasant..

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [8월 8, 2018, 10:40오전 UTC](https://meta.discourse.org/t/discobot-certificate-issues-title-public-access-user-id-information-leak/94177/12 "2018-08-08T10:40:07Z")

</div>

At minimum only logged in users should be able to trigger it though.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [8월 8, 2018, 10:43오전 UTC](https://meta.discourse.org/t/discobot-certificate-issues-title-public-access-user-id-information-leak/94177/13 "2018-08-08T10:43:35Z")

</div>

Oh we will fix this for sure, I just think it can wait till Monday, you should only be allowed to generate the svg file for yourself really

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [8월 8, 2018, 10:48오전 UTC](https://meta.discourse.org/t/discobot-certificate-issues-title-public-access-user-id-information-leak/94177/14 "2018-08-08T10:48:48Z")

</div>

> [@bkampmeyer](#):
>
> The ‘/u’ doesn’t work if you disable the setting ‘enable user directory’.

You are headed down a long rabbit hole here, what about autocomplete JSON api, type @a in a post and you can see the call. Fishing out all usernames is trivial that way. Seal that and then what about search, it searches for usernames, even anon gets to do that.

At some point you are destroying usability cause of an incorrect assumption

---

<div class="post-metadata">

### Author: ![bkampmeyer](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@bkampmeyer](https://meta.discourse.org/u/bkampmeyer)
#### Post date: [8월 8, 2018, 10:59오전 UTC](https://meta.discourse.org/t/discobot-certificate-issues-title-public-access-user-id-information-leak/94177/15 "2018-08-08T10:59:31Z")

</div>

> [@sam](#):
>
> You are headed down a long rabbit hole here

Starting to see that as well, thanks for the other hints regarding the userlists nonetheless!

I’m aware that Discourse wasn’t designed with such use cases in mind and that it’s quite a complex software so ensuring no user information is publicly available is either naive or unrealistic.

Apart from little customization issues we’re really thrilled by Discourse and it’s abilities, thanks for coding/testing/thinking/setting up/sharing!

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [8월 20, 2018, 3:27오전 UTC](https://meta.discourse.org/t/discobot-certificate-issues-title-public-access-user-id-information-leak/94177/16 "2018-08-20T03:27:33Z")

</div>

> [@bkampmeyer](#):
>
> the html ‘title’ tag is “test\_cert”

Fixed in

[https://github.com/discourse/discourse/commit/038de4e037193935565a8835409b39e696ec0eaf](https://github.com/discourse/discourse/commit/038de4e037193935565a8835409b39e696ec0eaf)

Thank you for reporting @bkampmeyer

> [@codinghorror](#):
>
> so at minimum anons shouldn’t be able to do this.

This is done in

[https://github.com/discourse/discourse/commit/07d07c7b5fd598c539d546c469bdce2b0bd957bb](https://github.com/discourse/discourse/commit/07d07c7b5fd598c539d546c469bdce2b0bd957bb)

---

<div class="post-metadata">

### Author: ![tgxworld](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tgxworld/32/106117_2.png) [@tgxworld](https://meta.discourse.org/u/tgxworld)
#### Post date: [8월 20, 2018, 3:27오전 UTC](https://meta.discourse.org/t/discobot-certificate-issues-title-public-access-user-id-information-leak/94177/17 "2018-08-20T03:27:41Z")

</div>


