View Issue Details

This bug affects 4 person(s).
 40
IDProjectCategoryView StatusLast Update
20235Bug reportsSurvey participants (Tokens)public2025-08-25 16:10
Reporterasshank Assigned Tolajosarpad  
PrioritynoneSeveritypartial_block 
Status closedResolutionfixed 
Product Version6.6.x 
Summary20235: 403 after saving survey with token
Description

Can't save a survey anymore with this version.
I restored the version from monday 18th, That works fine.

check:
https://lime6.assendelfthankes.nl/index.php/424941
token: 1212

fill in survey and [send]

Steps To Reproduce

create survey,
activate tokens
start survey with token
save

results in: 403 - forbidden Ongeldige toegangscode
(wrong token)

TagsNo tags attached.
Bug heat40
Complete LimeSurvey version number (& build)6.15.7+250820
I will donate to the project if issue is resolvedNo
Browseredge
Database type & versionmariadb
Server OS (if known) CentOS Linux 7.9.2009 (Core)
Webserver software & version (if known)apache
PHP Version8.2

Users monitoring this issue

Activities

asshank

asshank

2025-08-21 12:28

reporter   ~83270

see frontend_helper.php on line 392 there is the '403 - forbidden Invalid access code' thrown

plb222

plb222

2025-08-21 13:21

reporter   ~83271

Token is empty on endpage of survey and throws 403.
Problem is not the function but token is not in _SESSION at the time of loading the function.

yannick.jemmely

yannick.jemmely

2025-08-21 14:39

reporter   ~83272

Hello,
For information, I encounter the same issue on the version 6.15.6+250818
Kind regards

asshank

asshank

2025-08-21 15:10

reporter   ~83273

Yes, After 6.15.5+250724 it does not work anymore... I hoped 6.15.6+250820 adresses this issue. But no!

lshidden

lshidden

2025-08-22 07:27

reporter   ~83274

I had the same problem and did the following:
In the file /YOUR_DOCS_ROOT/limesurvey/application/helpers/SurveyRuntimeHelpers.php, starting at line 220

Replace this part:
if ($tokenValue && isset($_SESSION[$this->LEMsessid][“srid”])) {

            $oSurveyResponse = SurveyDynamic::model($this->iSurveyid)->findByAttributes([“id” => $_SESSION[$this->LEMsessid][“srid”]]);
            if ($oSurveyResponse->hasAttribute(“token”)) {
                $oSurveyResponse->token = $tokenValue;
            }
            if (isset($_SESSION[$this->LEMsessid][“filltoken”])) {
                unset($_SESSION[$this->LEMsessid][“filltoken”]);
            }
            if (isset($_SESSION[$this->LEMsessid][“token”])) {
                unset($_SESSION[$this->LEMsessid][“token”]);
            }

with

if (isset($_SESSION[$this->LEMsessid][“filltoken”]) && isset($_SESSION[$this->LEMsessid][“srid”])) {
$oSurveyResponse = SurveyDynamic::model($this->iSurveyid)->findByAttributes([“id” => $_SESSION[$this->LEMsessid][“srid”]]);

            $oSurveyResponse->token = $_SESSION[$this->LEMsessid][“filltoken”];
                            unset($_SESSION[$this->LEMsessid][“filltoken”]);

This is from the old version 6.15.5 and solves the problem, but it should be fixed accordingly in one of the next updates.

asshank

asshank

2025-08-22 09:04

reporter   ~83275

Tnx.
I hope this will be resolved soon...

asshank

asshank

2025-08-22 09:48

reporter   ~83276

I made a PR 04408 in github.. But it failed some unit tests... Hmmm... I give up! :-)

asshank

asshank

2025-08-22 09:54

reporter   ~83277

I can't fight with a bot.
The bot is rejecting my PR because the token is not removed ('possible' security concern), So if it will pass the bot, Tokenized surveys will not submit.. So I give up this fight!

lshidden

lshidden

2025-08-22 10:04

reporter   ~83278

That's strange, did you adjust the lines and does it work for you now?

asshank

asshank

2025-08-22 10:49

reporter   ~83279

@ishidden: I just removed lines 229-231 (the part where token is removed from object)
The (a) bot is tagging this as 'possible securiy concern'

asshank

asshank

2025-08-22 11:07

reporter   ~83280

@ishidden: Your code change and mine ar both working...

ESH_Webentwicklung

ESH_Webentwicklung

2025-08-25 07:45

reporter   ~83285

The solution (SurveyRuntimeHelpers.php, starting at line 220) from ishidden works for us. But a official solution ober comfort Update will be nice.

asshank

asshank

2025-08-25 10:08

reporter   ~83290

For us one thing is very clear... Token management is faulty in 6.15.7 and maybe 1 or 2 versions before that.
We went back to 6.15.1 and all works like a charm!
So maybe 6.15.4 of 6.15.5 will also work! I will check that out in the coming hours.

asshank

asshank

2025-08-25 10:47

reporter   ~83291

token management:
6.15.4 is OK
6.15.5 onward Fails

FabioSC

FabioSC

2025-08-25 11:07

reporter   ~83293

Have you verified that the token is available and that it does not appear as a completed questionnaire?

asshank

asshank

2025-08-25 11:22

reporter   ~83294

correction 6.15.4 is also at fault...
6.15.3 is OK

Fot us 6.15.3 is now frozen. No more updates until it is fixed.

@FabioSC token tables exists and a couple of oldtoken* also... activating a 'closed' survey should present a dialog where you can choose to import old tokens...
As of version 6.15.4 is is not happening anymore!

asshank

asshank

2025-08-25 11:27

reporter   ~83296

This form is not shown when activating a survey as of version 6.15.4
This is 6.15.3 (so it works as expected)

asshank

asshank

2025-08-25 11:59

reporter   ~83306

For what it is worth:
IMHO: https://github.com/LimeSurvey/LimeSurvey/pull/4300 is causing the issues

lajosarpad

lajosarpad

2025-08-25 13:54

developer   ~83309

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&id=39036

LimeBot

LimeBot

2025-08-25 14:18

administrator   ~83311

Fixed in Release 6.15.8+250825

asshank

asshank

2025-08-25 16:10

reporter   ~83313

Just installed Release 6.15.8+250825
403 submit: fixed

But all the other token managementproblems still exsists. So version 16.5.3. is still the stable one!

Related Changesets

LimeSurvey: master 69486691

2025-08-25 13:54

lajosarpad

Committer: GitHub


Details Diff
Fixed issue 20235: Applied fixes for tokens and anonymized (04407) LE-337 Affected Issues
20235
mod - application/helpers/SurveyRuntimeHelper.php Diff File
mod - application/helpers/frontend_helper.php Diff File
mod - application/views/admin/token/tokenform.php Diff File

Issue History

Date Modified Username Field Change
2025-08-21 12:13 asshank New Issue
2025-08-21 12:28 asshank Note Added: 83270
2025-08-21 12:28 asshank Bug heat 0 => 2
2025-08-21 13:14 guest Bug heat 2 => 8
2025-08-21 13:16 guest Bug heat 8 => 2
2025-08-21 13:16 plb222 Bug heat 2 => 8
2025-08-21 13:21 plb222 Note Added: 83271
2025-08-21 13:21 plb222 Bug heat 8 => 10
2025-08-21 14:39 yannick.jemmely Note Added: 83272
2025-08-21 14:39 yannick.jemmely Bug heat 10 => 12
2025-08-21 15:10 asshank Note Added: 83273
2025-08-21 17:38 guest Bug heat 12 => 18
2025-08-22 03:46 ujtwrujtwr Issue Monitored: ujtwrujtwr
2025-08-22 03:46 ujtwrujtwr Bug heat 18 => 20
2025-08-22 07:27 lshidden Note Added: 83274
2025-08-22 07:27 lshidden Bug heat 20 => 22
2025-08-22 09:04 asshank Note Added: 83275
2025-08-22 09:48 asshank Note Added: 83276
2025-08-22 09:54 asshank Note Added: 83277
2025-08-22 10:04 lshidden Note Added: 83278
2025-08-22 10:49 asshank Note Added: 83279
2025-08-22 11:07 asshank Note Added: 83280
2025-08-23 15:55 diegoCaso Issue Monitored: diegoCaso
2025-08-23 15:55 diegoCaso Bug heat 22 => 24
2025-08-25 07:45 ESH_Webentwicklung Note Added: 83285
2025-08-25 07:45 ESH_Webentwicklung Bug heat 24 => 26
2025-08-25 07:46 guest Bug heat 26 => 32
2025-08-25 10:08 asshank Note Added: 83290
2025-08-25 10:47 asshank Note Added: 83291
2025-08-25 11:06 FabioSC Issue Monitored: FabioSC
2025-08-25 11:06 FabioSC Bug heat 32 => 34
2025-08-25 11:07 FabioSC Note Added: 83293
2025-08-25 11:07 FabioSC Bug heat 34 => 36
2025-08-25 11:22 asshank Note Added: 83294
2025-08-25 11:27 asshank Note Added: 83296
2025-08-25 11:27 asshank File Added: Schermafbeelding 2025-08-25 112534.png
2025-08-25 11:59 asshank Note Added: 83306
2025-08-25 13:54 lajosarpad Changeset attached => LimeSurvey master 69486691
2025-08-25 13:54 lajosarpad Note Added: 83309
2025-08-25 13:54 lajosarpad Assigned To => lajosarpad
2025-08-25 13:54 lajosarpad Status new => resolved
2025-08-25 13:54 lajosarpad Resolution open => fixed
2025-08-25 13:54 lajosarpad Bug heat 36 => 38
2025-08-25 14:18 LimeBot Note Added: 83311
2025-08-25 14:18 LimeBot Status resolved => closed
2025-08-25 14:18 LimeBot Bug heat 38 => 40
2025-08-25 16:10 asshank Note Added: 83313