View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
14710 | Feature requests | Security | public | 2019-04-01 14:35 | 2023-02-04 11:38 |
Reporter | bulgin | Assigned To | |||
Priority | none | Severity | feature | ||
Status | new | Resolution | open | ||
Summary | 14710: Request to log unauthorized token entries | ||||
Description | It is common for bots and people to attempt to hack limesurvey via tokens. If administrators test the "crackability" of the lime survey generated tokens less than 6 characters on any number of online sites that test passwords, you will see that these tokens are easily cracked in under 60 seconds. A solution is easy: log failed attempts to any number of logs files and then we can use systems like csf and other log-monitoring software to block the ips after X attempts. For example, the limesurvey generated password: 0hMRb7 can be cracked in 3 hours by a home computer according to kapsersky online password tester and reportedly in 1 second by howsecureismypassword.net. | ||||
Additional Information | Limesurvey does offer the option to create long passwords that are more difficult to crack, however, in many use cases administrators need to send password tokens to users not as a link, but as the actual password (for example in a survey in which the participants are invited via regular postal mail, etc.). One use case is a survey being administered to people with disabilities or seniors. The fact that some populations have limited access to technology should not deter them from taking surveys, in my view, yet surveys for disadvantaged people with disables are useful for improving their lives, although this is just one use case. It would be very beneficial to therefore have the token as something that can be easily copied and input without too much difficulty. If a brute force attack is being used, then by creating a log of such activity we, as administrators, can simply block the ip or send them elsewhere. Thank you. | ||||
Tags | No tags attached. | ||||
Bug heat | 264 | ||||
Story point estimate | 5 | ||||
Users affected % | 10 | ||||
Suggestion: 401 requires the originating server to send a WWW-Authenticate header field which I don't think happens in this case and 403 has similar requirements. From RFC 2616 I think a 400 would be the best: 400 Bad Request The request could not be understood by the server due to malformed syntax. The client SHOULD NOT repeat the request without modifications. |
|
Yep, right, not exactly a 401 (even a 400 in fact). Currently seems you can use https://github.com/LimeSurvey/LimeSurvey/blob/f62a73c8ff91a4d501517fc6cd4532cab1da6231/application/controllers/survey/index.php#L478 onSurveyDenied event : and then log it or send a 400 ? |
|
Looks promising! So what's the next step to log this information? Even if tweaked locally before any kind of update. I'm not such a great code maven. |
|
+1 |
|
While I think that this is a nice idea I wonder a little about the benefit. If you successfully find a valid token, what can you do with it? And maybe even more important: Why should you do that at all? What's your benefit? |
|
Valid token : user information : can be a great great great benefit. You don't known what our user do with LimeSurvey … |
|
I agree, if the survey is not anonymous and user details are embedded at the survey, that is indeed a risk. |
|
I'm trying to understand the responses. The only benefit is to block malicious behavior against token entries, and thereby prevent a malicious user from gaining access to a survey. From my position it seems this can be easily done by logging failed token access attempts to a custom log file, and then blocking that IP address with programs like csf (ConfigServer) and others. |
|
FYI: programs like ConfigServer and Fail2Ban simply monitor repeated failed attempts in log files and then block them by IP after X attempts. |
|
@bulgin : yes , but fail2ban can track 400 error directly too |
|
@DenisChenu Yes, I saw your reference. Just don't understand how I can integrate that for desired result or were you just identifying an area of the code were this information is already captured? So my question is: now what? |
|
See a sample plugin : https://github.com/LimeSurvey/LimeSurvey/blob/master/plugins/Demo/ShowResponse/ShowResponse.php Add this (not tested) in the function
Use Yii to log it where you want exactly : https://manual.limesurvey.org/Optional_settings#Logging_settings |
|
Since this is an advanced feature I'm setting user value/users affected to 10%. Let me know if you disagree with this. |
|
We have a disable by IP too :) can be improved (separation with admin part), but yes. Have a token code only is hard to do. |
|
Date Modified | Username | Field | Change |
---|---|---|---|
2019-04-01 14:35 | bulgin | New Issue | |
2019-04-01 14:36 | bulgin | Issue Monitored: bulgin | |
2019-04-01 14:39 | bulgin | Note Added: 51243 | |
2019-04-01 15:23 | DenisChenu | Issue Monitored: DenisChenu | |
2019-04-01 15:27 | DenisChenu | Note Added: 51247 | |
2019-04-01 17:31 | bulgin | Note Added: 51251 | |
2019-04-03 09:30 | ritapas | Note Added: 51291 | |
2019-04-05 08:49 | Mazi | Note Added: 51356 | |
2019-04-05 08:54 | DenisChenu | Note Added: 51360 | |
2019-04-05 09:28 | Mazi | Note Added: 51369 | |
2019-04-05 14:37 | bulgin | Note Added: 51386 | |
2019-04-05 14:39 | bulgin | Note Added: 51387 | |
2019-04-05 14:54 | DenisChenu | Note Added: 51388 | |
2019-04-05 15:07 | bulgin | Note Added: 51389 | |
2019-04-05 15:29 | DenisChenu | Note Added: 51390 | |
2023-02-03 18:02 | ollehar | Story point estimate | => 5 |
2023-02-03 18:02 | ollehar | Users affected % | => 10 |
2023-02-03 18:02 | ollehar | Note Added: 73661 | |
2023-02-03 18:02 | ollehar | Bug heat | 262 => 264 |
2023-02-04 11:38 | DenisChenu | Note Added: 73670 |