View Issue Details

This bug affects 1 person(s).
 10
IDProjectCategoryView StatusLast Update
19960Bug reportsSurvey participants (Tokens)public2025-02-21 21:04
Reportertassoman Assigned Togabrieljenik  
PrioritynoneSeverityminor 
Status in code reviewResolutionopen 
Product Version6.6.x 
Summary19960: Registration Form spamming19
Description

When you set "public registration" attribute on, survey starts asking personal data (see: 19958) when you register https://limesurvey.local/index.php/register/index?sid=938936 you're sending a POST request.
By sending multiple times the same form (CTRL+R, and confirm send data), the email address get spammed. No session check is avoiding multiple posts. (you should be able to send it once for session)

Steps To Reproduce

Steps to reproduce

Create a survey
Set it to closed access (participant list)
Set it to public registration
Enable survey
Open survey in a private browser window
Register to survey
Press multiple times CTRL+R / F5 while being on conclusion page. Confirm data sending.
See: multiple mail are sent to that address.

Expected result

As administrator I want survey participant to register only once per session.

Actual result

Email address in POST data gets automatically spammed at each request.

Tagsparticipants, public registration, spam
Bug heat10
Complete LimeSurvey version number (& build)6.10.x
I will donate to the project if issue is resolvedNo
BrowserAny
Database type & versionAny
Server OS (if known)Any
Webserver software & version (if known)Any
PHP Version8.2

Users monitoring this issue

tassoman

Activities

DenisChenu

DenisChenu

2025-02-12 13:14

developer   ~82010

By sending multiple times the same form (CTRL+R, and confirm send data), the email address get spammed. No session check is avoiding multiple posts. (you should be able to send it once for session)

We allow same email used again and again ?
I think only one token by email are allowed here.

tassoman

tassoman

2025-02-12 16:10

reporter   ~82012

Hello @DenisChenu actually, the same token gets spammed many times. Maybe only one request per session is not enough, when people can't receive instantly their email for example.
So, maybe a calm-down throttle, configurable by advanced settings is enough to limit sending one email per minute / N minutes for the same token.

tibor.pacalat

tibor.pacalat

2025-02-12 17:37

administrator   ~82016

It is true, someone could spam someone else's email account using Limesurvey. But only one participant is being created with the same email address.

tassoman

tassoman

2025-02-12 18:23

reporter   ~82017

I'm sorry I wrong typed Expected result. As you noted, registration is ok, happens only once. Correct user story is:
As administrator I want survey participant to get only one notification per session so that spamming personal or others email address can be limited.

Implementation suggestion:

  • When "public registration" happens, participant have a token and invited-datetime. Just update invited-datetime each time same email gets registered for participation.
  • Add an integer in advanced configuration "calmdown-notification-onregistration-seconds" (default 60)
  • When "public registration" form is posted, check for existing invited datetime, convert to unixtimestamp integer, check against NOW() timestamp.
  • Validate if difference is greater than calmdown configuration. If can't validate simply throw an error at form submission with translatable string "Please wait a few moments before sending another notification"

Optional UI-UX interface

  • a javascript time counter tells the user when submit form again
  • a button submit the form again
    Useful when participant didn't recieved their email message.
tassoman

tassoman

2025-02-12 18:33

reporter   ~82018

If you want to do very well perfectly. Form should trigger "invited datetime" only first time when not existant. On token creation.
Then each time participant is already registered, system could update "reminder datetime".

Instead of using a new configuration value, maybe already existent reminder notification rules can be used.

  • Max reminders:
  • Min days between reminders:

But I'm still in favour for a configurable time in seconds.

DenisChenu

DenisChenu

2025-02-12 19:27

developer   ~82019

It is true, someone could spam someone else's email account using Limesurvey. But only one participant is being created with the same email address.

Oh yes : in 3.X : we send "Already registered" but no email.
In 5.X : already registered + email sent

New global configuration ? Throttle to 3600s by default ? No need JS

gabrieljenik

gabrieljenik

2025-02-17 20:16

manager   ~82050

https://github.com/LimeSurvey/LimeSurvey/pull/4170

DenisChenu

DenisChenu

2025-02-18 10:06

developer   ~82055

In 5.X : already registered + email sent

We need to keep this :it's a good solution. But need a throttle (and a different message) byè config.php (for starting, adding it in GUI are a feature)

gabrieljenik

gabrieljenik

2025-02-20 16:57

manager   ~82103

@tibor.pacalat

Right now the solution avoids spam. Only sends email once.
Shall we add as well throttling to the solution so multiple emails can be sent with some time in between them?

DenisChenu

DenisChenu

2025-02-20 17:03

developer   ~82106

Only sends email once.

It was a feature request done between 3 and 5 : receive the email when registered a second time with same email.

gabrieljenik

gabrieljenik

2025-02-21 14:15

manager   ~82109

Last edited: 2025-02-21 14:16

There is a sent field on the token tables.
We could use that to at least send the email once per day.
Shall we?

DenisChenu

DenisChenu

2025-02-21 14:40

developer   ~82110

There is a sent field on the token tables.

And we update it when we send email by register.

We could use that to at least send the email once per day.

Yes, or by a config.php setting (best IMHO)

gabrieljenik

gabrieljenik

2025-02-21 15:03

manager   ~82111

by a config.php setting (best IMHO)

That would be a bigger scope, a Feature Request.
We would need to create an extra field for tracking how many times have we sent the token.
Not complicate, but would ask @tibor.pacalat that we can work on that here.

tassoman

tassoman

2025-02-21 15:14

reporter   ~82112

Is it necessary to save how many times a token was sent? I agree too much implementation.
In previous posts I just suggested to write actual time to "creation datetime", when token is created, and writing into "remainder datetime" any time participant get a notification.
In this situation you can control "notification age" and throttle or not. No need for adding new fields.

https://bugs.limesurvey.org/view.php?id=19960#c82018

gabrieljenik

gabrieljenik

2025-02-21 15:23

manager   ~82113

and writing into "remainder datetime" any time participant get a notification.

That may create confusion in the reminder system.
Still, we have a sent field we could use.

What we wouldn't be able to do is control how many times per day (or absolute) to be sent.
That would be out of scope. Only once per day max

@tibor.pacalat we need a decision here. Thanks!

tibor.pacalat

tibor.pacalat

2025-02-21 15:41

administrator   ~82114

@gabrieljenik I would say once per day max is fine. Can we also provide feedback to the user?

gabrieljenik

gabrieljenik

2025-02-21 15:46

manager   ~82116

Can we also provide feedback to the user?

Yes, we would send different messages for the different situations

DenisChenu

DenisChenu

2025-02-21 17:32

developer   ~82121

We would need to create an extra field for tracking how many times have we sent the token.

No, just limit by hour, you write day : i think best is to set a value in hour (maybe minute) to do not send it each second.

Just : if now - sent < app()->getConfig('register_throttle')

There are no mimit by X , just don't send it each miliseocnds. I think one hour by default is great. Like when trying to register on any website : you can ask a second code after X minutes.

DenisChenu

DenisChenu

2025-02-21 17:34

developer   ~82122

Adding a minimum delay between each sending is what needs to be done to avoid large-scale spam and the blocking of the email address.
I just ask that this delay be in the configuration and not as a fixed value in the code."

gabrieljenik

gabrieljenik

2025-02-21 21:04

manager   ~82125

Updated the PR.

https://github.com/LimeSurvey/LimeSurvey/pull/4170/files#diff-6f4ac27feb3ec162fd8a3d164030e24d3d121a2df9768a626ce18d9e4649fbc4R352
The part about updating the message sent to the user is kind of complicated as requires to reorganize the whole controller and view.
Success Message is hardcoded and code is a bit complex.

Shall we plan that on another ticket @tibor.pacalat? Thoughts?

Issue History

Date Modified Username Field Change
2025-02-12 12:48 tassoman New Issue
2025-02-12 12:49 tassoman Tag Attached: public registration
2025-02-12 12:49 tassoman Tag Attached: participants
2025-02-12 12:49 tassoman Tag Attached: spam
2025-02-12 13:06 tassoman Issue Monitored: tassoman
2025-02-12 13:06 tassoman Bug heat 0 => 2
2025-02-12 13:14 DenisChenu Note Added: 82010
2025-02-12 13:14 DenisChenu Bug heat 2 => 4
2025-02-12 16:10 tassoman Note Added: 82012
2025-02-12 16:10 tassoman Bug heat 4 => 6
2025-02-12 17:37 tibor.pacalat Note Added: 82016
2025-02-12 17:37 tibor.pacalat Bug heat 6 => 8
2025-02-12 17:37 tibor.pacalat Assigned To => gabrieljenik
2025-02-12 17:37 tibor.pacalat Status new => assigned
2025-02-12 18:23 tassoman Note Added: 82017
2025-02-12 18:33 tassoman Note Added: 82018
2025-02-12 19:27 DenisChenu Note Added: 82019
2025-02-17 20:16 gabrieljenik Assigned To gabrieljenik => DenisChenu
2025-02-17 20:16 gabrieljenik Status assigned => ready for code review
2025-02-17 20:16 gabrieljenik Note Added: 82050
2025-02-17 20:16 gabrieljenik Bug heat 8 => 10
2025-02-18 10:06 DenisChenu Status ready for code review => in code review
2025-02-18 10:06 DenisChenu Note Added: 82055
2025-02-18 10:06 DenisChenu Assigned To DenisChenu => gabrieljenik
2025-02-20 16:57 gabrieljenik Note Added: 82103
2025-02-20 17:03 DenisChenu Note Added: 82106
2025-02-21 14:15 gabrieljenik Note Added: 82109
2025-02-21 14:16 gabrieljenik Note Edited: 82109
2025-02-21 14:40 DenisChenu Note Added: 82110
2025-02-21 15:03 gabrieljenik Note Added: 82111
2025-02-21 15:14 tassoman Note Added: 82112
2025-02-21 15:23 gabrieljenik Note Added: 82113
2025-02-21 15:41 tibor.pacalat Note Added: 82114
2025-02-21 15:46 gabrieljenik Note Added: 82116
2025-02-21 17:32 DenisChenu Note Added: 82121
2025-02-21 17:34 DenisChenu Note Added: 82122
2025-02-21 21:04 gabrieljenik Note Added: 82125