Codeberg/Community
55
329
Fork
You've already forked Community
12

Account registration attempts with scraped emails potentially lead to blacklisting Codeberg emails #298

Closed
opened 2020年10月02日 09:58:54 +02:00 by hw · 18 comments
Member
Copy link

In the last few days we received reports from Cloudmark, Yandex, Microsoft that they are flooded with Codeberg activation emails users flag as spam. We see in our logs many accounts with random usernames that never active, so the reports seem to have a foundation. It seems to work like this:

  • evil guy get some lists with email accounts,
  • evil guy tries to register (manually or even semi-automated) codeberg.org accounts with these addresses,
  • email address owners get unsolicited activation email and hit the spam button.

Question: As we are not involved in the loop, what can we do to stop this problem?

In the last few days we received reports from Cloudmark, Yandex, Microsoft that they are flooded with Codeberg activation emails users flag as spam. We see in our logs many accounts with random usernames that never active, so the reports seem to have a foundation. It seems to work like this: - evil guy get some lists with email accounts, - evil guy tries to register (manually or even semi-automated) codeberg.org accounts with these addresses, - email address owners get unsolicited activation email and hit the spam button. Question: As we are not involved in the loop, what can we do to stop this problem?

Is it possible to provide an extra security challenge step if certain conditions are met?
Because there are email reputation services out there, haveibeenpwnd could be checked, things like that. It's quite likely that if the address was scraped it's on haveibeenpwnd.

Instead of blocking (possibly legitimate) users, one could then pose another step. "I hereby declare that I'm a real user" and post a second captcha or similar solution. That would most likely stop automated registering?

Is it possible to provide an extra security challenge step if certain conditions are met? Because there are email reputation services out there, haveibeenpwnd could be checked, things like that. It's quite likely that if the address was scraped it's on haveibeenpwnd. Instead of blocking (possibly legitimate) users, one could then pose another step. "I hereby declare that I'm a real user" and post a second captcha or similar solution. That would most likely stop automated registering?

At least for the microsoft "galaxy" you could request access through this page:
https://sendersupport.olc.protection.outlook.com/snds/index.aspx

This will get you a warning when someone marks emails coming from IPs you control as spam.

It's mostly a way to get informed AFAIK, it does not allow to appeal against any decision nor ask to be removed from any spam list.

The registration is (convoluted but) free as in gratis the person registering needs a microsoft account.

At least for the microsoft "galaxy" you could request access through this page: https://sendersupport.olc.protection.outlook.com/snds/index.aspx This will get you a warning when someone marks emails coming from IPs you control as spam. It's mostly a way to get informed AFAIK, it does not allow to appeal against any decision nor ask to be removed from any spam list. The registration is (convoluted but) free as in gratis the person registering needs a microsoft account.

Do we keeps logs about registration attempts and the IPs they came from?

Do we keeps logs about registration attempts and the IPs they came from?

I like @sexybiggetje to re-think the registration process. How to take this a step further:

  1. Manual approvals of registrations. This might annoy users and introduce additional work for us, but it would avoid scripted account creations.
  2. Invite-based registrations and limit the number of invites per user per time unit.
  3. Close "free" registration for a bit.
I like @sexybiggetje to re-think the registration process. How to take this a step further: 1. Manual approvals of registrations. This might annoy users and introduce additional work for us, but it would avoid scripted account creations. 2. Invite-based registrations and limit the number of invites per user per time unit. 3. Close "free" registration for a bit.
Author
Member
Copy link

Do we keeps logs about registration attempts and the IPs they came from?

7 days as described in Terms of Use

> Do we keeps logs about registration attempts and the IPs they came from? 7 days as described in [Terms of Use](https://codeberg.org/codeberg/org/src/branch/master/TermsOfUse.md)

@tklein23 I'm unfamiliar with the codebase (and go). I have tried looking at the gitea source to see what options there are. Looks like they don't have a system of hooks there.

Option 1;
Is making multifactor authentication required an option? Or doesn't Gitea provide that as a mandatory option during registration?

Option 2;

What's involved with manual approving? Because we might turn on manual approving, and if possible create a system account that approves accounts on request via the API. (If the API provides an endpoint for this).

That we one could fire up a cronjob that does several things:

  1. Check the e-mail address for reputation
  2. Check the domain for reputation
  3. Approve the request, or leave it open for manual tasks
  4. Send custom mail to "support@codeberg" and "enduser" with a message akin to "We have choosen not to accept your registration because of the reputation services we use flagged your e-mail. If this is in error, please contact xyz"

This would still trigger some emails to those addresses, so this might not be the best alternative. But it could provide an extra step.

@tklein23 I'm unfamiliar with the codebase (and go). I have tried looking at the gitea source to see what options there are. Looks like they don't have a system of hooks there. Option 1; Is making multifactor authentication required an option? Or doesn't Gitea provide that as a mandatory option during registration? Option 2; What's involved with manual approving? Because we might turn on manual approving, and if possible create a system account that approves accounts on request via the API. (If the API provides an endpoint for this). That we one could fire up a cronjob that does several things: 1) Check the e-mail address for reputation 2) Check the domain for reputation 3) Approve the request, or leave it open for manual tasks 4) Send custom mail to "support@codeberg" and "enduser" with a message akin to "We have choosen not to accept your registration because of the reputation services we use flagged your e-mail. If this is in error, please contact xyz" This would still trigger some emails to those addresses, so this might not be the best alternative. But it could provide an extra step.

@sexybiggetje For the manual approval process you have described, could we prevent sending out mails if we modify the process to check the email reputation right when sending the registration form?

Because that way we could confine accounts with scraped email-adresses to "quarantine" and inform the user about that in the response page after sending their registration form instead of per mail triggered by cronjob. Accounts with good email reputation would not be sent to quarantine and instead would follow the regular registration-with-douple-opt-in process.

@sexybiggetje For the manual approval process you have described, could we prevent sending out mails if we modify the process to check the email reputation right when sending the registration form? Because that way we could confine accounts with scraped email-adresses to "quarantine" and inform the user about that in the response page after sending their registration form instead of per mail triggered by cronjob. Accounts with good email reputation would not be sent to quarantine and instead would follow the regular registration-with-douple-opt-in process.

I think that could be possible but requires patching on Gitea. Or one would need to "trap" those emails in the SMTP server to prevent them from going out. But no clue how to achieve that.

I think that could be possible but requires patching on Gitea. Or one would need to "trap" those emails in the SMTP server to prevent them from going out. But no clue how to achieve that.

I think this is a nice feature for gitea ... so all can benefit, if somebody has time to implement it

EDIT: I also like to have this for my instance ...

I think this is a nice feature for gitea ... so all can benefit, if somebody has time to implement it EDIT: I also like to have this for my instance ...
Author
Member
Copy link

Option 1;
Is making multifactor authentication required an option? Or doesn't Gitea provide that as a mandatory option during registration?

I like the idea of advertising the use of 2FA more prominently.

Option 2;

What's involved with manual approving? Because we might turn on manual approving, and if possible create a system account that approves accounts on request via the API. (If the API provides an endpoint for this).

That we one could fire up a cronjob that does several things:

  1. Check the e-mail address for reputation

Problem is that these registrations use valid email addresses of random people (who never heard about Codeberg or Gitea and thus think this is spam).

> Option 1; > Is making multifactor authentication required an option? Or doesn't Gitea provide that as a mandatory option during registration? I like the idea of advertising the use of 2FA more prominently. > Option 2; > > What's involved with manual approving? Because we might turn on manual approving, and if possible create a system account that approves accounts on request via the API. (If the API provides an endpoint for this). > > That we one could fire up a cronjob that does several things: > 1) Check the e-mail address for reputation Problem is that these registrations use valid email addresses of random people (who never heard about Codeberg or Gitea and thus think this is spam).
hw changed title from (削除) [URGENT] Account registration attempts with scraped emails lead to blacklisting Codeberg emails (削除ここまで) to Account registration attempts with scraped emails lead to blacklisting Codeberg emails 2020年10月23日 22:10:42 +02:00
hw changed title from (削除) Account registration attempts with scraped emails lead to blacklisting Codeberg emails (削除ここまで) to Account registration attempts with scraped emails potentially lead to blacklisting Codeberg emails 2020年10月23日 22:10:52 +02:00
Author
Member
Copy link

It seems we got whitelisted in this case, email checker tools report green again. (the underlying mechanism itself ofc might get exploited again in the future).

Maybe one step forward: https://github.com/go-gitea/gitea/issues/13283.

It seems we got whitelisted in this case, email checker tools report green again. (the underlying mechanism itself ofc might get exploited again in the future). Maybe one step forward: https://github.com/go-gitea/gitea/issues/13283.

UPDATE: I'll focus on "[Feature] block-/allow-list for emails (#13628)" ... it might be an impruvement

UPDATE: I'll focus on "[[Feature] block-/allow-list for emails (#13628)](https://github.com/go-gitea/gitea/issues/13628)" ... it might be an impruvement

If there is a connection with my issue #191, then it must be the Outlook server.
I was waiting for an activation email which the server had unilaterally flagged as spam. But even when I reversed that flag (to make the link clickable), the link only caused the server to respond with "Bad Request". Clicking the same link from within gmail, later, caused no problems.

The only link I see between the two issues, is Outlook and Codeberg. Outlook's server marking the email as spam is one part. But that isn't what causes the "Bad Request" response when clicking the link.

If there *is* a connection with my issue #191, then it must be the Outlook server. I was *waiting* for an activation email which the server had unilaterally flagged as spam. But even when I reversed that flag (to make the link clickable), the link only caused the server to respond with "Bad Request". Clicking the same link from within gmail, later, caused no problems. The only link I see between the two issues, is Outlook and Codeberg. Outlook's server marking the email as spam is one part. But that isn't what causes the "Bad Request" response when clicking the link.
Author
Member
Copy link

But that isn’t what causes the "Bad Request" response when clicking the link.

Could it be that this was outdated? Does this also happen for a second re-activation attempt?

> But that isn’t what causes the "Bad Request" response when clicking the link. Could it be that this was outdated? Does this also happen for a second re-activation attempt?

But that isn’t what causes the "Bad Request" response when clicking the link.

Could it be that this was outdated? Does this also happen for a second re-activation attempt?

Outdated my foot! And yes, it happened for every activation attempt, as long as I tried to click the link on live.com.

I'll recount the events in order:

  1. I registered here
  2. I immediately went to see if the activation email had appeared in my gmail box. It hadn't.
  3. I went to live.com, where I found it in spam (hence why it hadn't appeared in gmail)
  4. I removed the spam-flag, clicked the link, and got "Bad Request". I waited till the following moring, perhaps, there was some problem at live.com...
  5. Next day, the email was outdated, so...
  6. I came back here, requested a second activation email.
  7. I went DIRECTLY to live.com, where I found it in spam again, unflagged it, clicked the link: again "Bad Request".
  8. I waited for the second email to appear in my Gmail account, clicked the link, and it worked!

For reference, reread issue #191 !!

> > But that isn’t what causes the "Bad Request" response when clicking the link. > > Could it be that this was outdated? Does this also happen for a second re-activation attempt? Outdated my foot! And yes, it happened for every activation attempt, as long as I tried to click the link on live.com. I'll recount the events in order: 1. I registered here 2. I immediately went to see if the activation email had appeared in my gmail box. It hadn't. 3. I went to live.com, where I found it in spam (hence why it hadn't appeared in gmail) 4. I removed the spam-flag, clicked the link, and got "Bad Request". I waited till the following moring, perhaps, there was some problem at live.com... 5. Next day, the email was outdated, so... 6. I came back here, requested a second activation email. 7. I went DIRECTLY to live.com, where I found it in spam again, unflagged it, clicked the link: again "Bad Request". 8. I waited for the second email to appear in my Gmail account, clicked the link, and it worked! For reference, reread issue #191 !!
Author
Member
Copy link

Outdated my foot!

Outdated in this context is if the activation takes more than 3 hours.

For reference, reread issue #191 !!

thank you!

> Outdated my foot! Outdated in this context is if the activation takes more than 3 hours. > For reference, reread issue #191 !! thank you!

Outdated in this context is if the activation takes more than 3 hours.

That much was obvious, thank you.

thank you!

You're welcome.

> Outdated in this context is if the activation takes more than 3 hours. That much was obvious, thank you. > thank you! You're welcome.
Owner
Copy link

Having an eye on email reputation is an ongoing and repeated task of course. Better spam protection is tracked in other issues, so I'll close this. Thank you for the discussion.

Having an eye on email reputation is an ongoing and repeated task of course. Better spam protection is tracked in other issues, so I'll close this. Thank you for the discussion.
Sign in to join this conversation.
No Branch/Tag specified
main
No results found.
Labels
Clear labels
accessibility

Reduces accessibility and is thus a "bug" for certain user groups on Codeberg.
bug

Something is not working the way it should. Does not concern outages.
bug
infrastructure

Errors evidently caused by infrastructure malfunctions or outages
Codeberg

This issue involves Codeberg's downstream modifications and settings and/or Codeberg's structures.
contributions welcome

Please join the discussion and consider contributing a PR!
docs

No bug, but an improvement to the docs or UI description will help
duplicate

This issue or pull request already exists
enhancement

New feature
infrastructure

Involves changes to the server setups, use `bug/infrastructure` for infrastructure-related user errors.
legal

An issue directly involving legal compliance
licence / ToS

involving questions about the ToS, especially licencing compliance
please chill
we are volunteers

Please consider editing your posts and remember that there is a human on the other side. We get that you are frustrated, but it's harder for us to help you this way.
public relations

Things related to Codeberg's external communication
question

More information is needed
question
user support

This issue contains a clearly stated problem. However, it is not clear whether we have to fix anything on Codeberg's end, but we're helping them fix it and/or find the cause.
s/Forgejo

Related to Forgejo. Please also check Forgejo's issue tracker.
s/Forgejo/migration

Migration related issues in Forgejo
s/Pages

Issues related to the Codeberg Pages feature
s/Weblate

Issue is related to the Weblate instance at https://translate.codeberg.org
s/Woodpecker

Woodpecker CI related issue
security

involves improvements to the sites security
service

Add a new service to the Codeberg ecosystem (instead of implementing into Gitea)
upstream

An open issue or pull request to an upstream repository to fix this issue (partially or completely) exists (i.e. Gitea, Forgejo, etc.)
wontfix

Codeberg's current set of contributors are not planning to spend time on delegating this issue.
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
8 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Codeberg/Community#298
Reference in a new issue
Codeberg/Community
No description provided.
Delete branch "%!s()"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?