View Issue Details

This bug affects 1 person(s).
 256
IDProjectCategoryView StatusLast Update
20269Bug reportsSecuritypublic2025-10-06 17:03
ReporterMazi Assigned Totibor.pacalat  
PrioritynoneSeverityblock 
Status resolvedResolutionfixed 
Product Version6.6.x 
Summary20269: Cross-site Scripting (XSS) affecting bootstrap-switch package
Description

According to a recent pentest, the bootstrap-switch package (version 3.3.2 located at h.../tmp/assets/e4430015/js/bootstrap-switch.min.js) has an XSS vulnerability.
Source: https://security.snyk.io/package/npm/bootstrap-switch/3.3.2
There is a fix available but that never got added to the next release, see https://github.com/Bttstrp/bootstrap-switch/pull/730
It also seems that the library is not maintained any more since several years: https://github.com/sensyn-robotics/bootstrap-switch

Can we replace/remove this outdated library?

The organisation which ran the pentest has a strict policy. They can only use Limesurvey once old/outdated libraries with security issues have been adjusted.

Steps To Reproduce

Steps to reproduce

Check Limesurvey for vulnerabilities/outdated libraries.

Expected result

In a perfect world everything would be up to date and there would be no issues.

Actual result

Outdated library with vulnerability.

TagsNo tags attached.
Bug heat256
Complete LimeSurvey version number (& build)6.15.2
I will donate to the project if issue is resolvedNo
Browser
Database type & versionx
Server OS (if known)
Webserver software & version (if known)
PHP Versionx

Relationships

child of 20273 resolvedtibor.pacalat Research if Limesurvey is using bootstrap-switch library so it can be removed from the code base 

Users monitoring this issue

There are no users monitoring this issue.

Activities

Mazi

Mazi

2025-09-19 08:41

updater   ~83444

@DenisChenu, any thoughts on how to best deal with this?

DenisChenu

DenisChenu

2025-09-19 09:09

developer   ~83445

Last edited: 2025-09-19 09:10

  1. There are no real issue with LimeSurvey since simple user can not add $('[data-toggle="switch"]').bootstrapSwitch() and admin user can add alert('XSS')
  2. You loose something moveing fro html to text

Globally : i don't understand fixing a JS script where user must set a specific JS . If he can set JS : he can just add XSS how he want.

Still a good idea to move to https://getbootstrap.com/docs/5.0/forms/checks-radios/#switches and remove bootstrapSwitch
Or just use a checkbox … (or dropdown or radio)

Mazi

Mazi

2025-09-19 09:20

updater   ~83446

@DenisChenu: I second this. This is the reason why I hate these automated pentests. They often show issues which are no real use case at all. But if the company has a strict policy, they may not be allowed to use Limesurvey due to such questionable findings.

DenisChenu

DenisChenu

2025-09-19 09:37

developer   ~83447

Last edited: 2025-09-19 09:37

My real opinion :

Or just use a checkbox … (or dropdown or radio)

Simple and clean, 1. No need JS, 2. A11Y proof, 3. Stability proof,

There are 4. Can use helper of browser, 5. Can use specific theme by user choice, except we force some update here (not always a good idea)

Mazi

Mazi

2025-09-19 10:26

updater   ~83450

Bootstrap 5/6 supports .form-switch which should be a possible alternative to get rid of this library.
https://getbootstrap.com/docs/5.3/forms/checks-radios/#switches

DenisChenu

DenisChenu

2025-09-19 10:30

developer   ~83451

Or just a checkbox ;)

tibor.pacalat

tibor.pacalat

2025-09-19 15:24

administrator   ~83453

I will create a research ticket that needs to be handled first since it looks like we don't use bootstrap-switch any more, but there may be plugins that use it.

tibor.pacalat

tibor.pacalat

2025-09-19 15:32

administrator   ~83454

https://bugs.limesurvey.org/view.php?id=20273

Mazi

Mazi

2025-09-26 09:29

updater   ~83486

@DenisChenu @tibor.pacalat: Is this library used at the admin backend only or also for running surveys?

Mazi

Mazi

2025-09-26 09:45

updater   ~83487

@DenisChenu @tibor.pacalat: Another finding
a) At path /assets/packages/bootstrap/plugins/switch/js/ we are using the old version 3.3.2 returning the security issue: https://github.com/LimeSurvey/LimeSurvey/blob/master/assets/packages/bootstrap/plugins/switch/js/bootstrap-switch.js
b) At path /assets/scripts/admin/ the newer 3.3.4 version is used: https://github.com/LimeSurvey/LimeSurvey/blob/master/assets/scripts/admin/bootstrap-switch.js

This is the commit for updating parts of LS from 3.3.2 to 3.3.4: https://github.com/LimeSurvey/LimeSurvey/commit/34d67e356dd997fa30c125c4dbbde9b188866b11
3.3.4 is the latest version available, see https://github.com/Bttstrp/bootstrap-switch/releases.

-> So maybe updating the outdated 3.3.2 files to 3.3.4 will already solve some pentest issues in case of reported outdated libraries.

tibor.pacalat

tibor.pacalat

2025-10-06 14:26

administrator   ~83540

This has been resolved via https://bugs.limesurvey.org/view.php?id=20273.

Mazi

Mazi

2025-10-06 15:05

updater   ~83542

@tibor,pacalat, I didn't see any related commit. What is the actual solution? Will the library be removed.

tibor.pacalat

tibor.pacalat

2025-10-06 17:03

administrator   ~83551

Library was not removed, but the references to it were. We had an issue when we deployed this to cloud, and we are handling this as we speak.

Issue History

Date Modified Username Field Change
2025-09-19 08:40 Mazi New Issue
2025-09-19 08:41 Mazi Note Added: 83444
2025-09-19 08:41 Mazi Bug heat 250 => 252
2025-09-19 09:09 DenisChenu Note Added: 83445
2025-09-19 09:09 DenisChenu Bug heat 252 => 254
2025-09-19 09:09 DenisChenu Note Edited: 83445
2025-09-19 09:10 DenisChenu Note Edited: 83445
2025-09-19 09:20 Mazi Note Added: 83446
2025-09-19 09:37 DenisChenu Note Added: 83447
2025-09-19 09:37 DenisChenu Note Edited: 83447
2025-09-19 10:26 Mazi Note Added: 83450
2025-09-19 10:30 DenisChenu Note Added: 83451
2025-09-19 15:24 tibor.pacalat Note Added: 83453
2025-09-19 15:24 tibor.pacalat Bug heat 254 => 256
2025-09-19 15:26 tibor.pacalat Assigned To => tibor.pacalat
2025-09-19 15:26 tibor.pacalat Status new => assigned
2025-09-19 15:32 tibor.pacalat Note Added: 83454
2025-09-26 09:29 Mazi Note Added: 83486
2025-09-26 09:45 Mazi Note Added: 83487
2025-09-29 09:48 Mazi Relationship added child of 20273
2025-10-06 14:26 tibor.pacalat Note Added: 83540
2025-10-06 14:27 tibor.pacalat Status assigned => resolved
2025-10-06 14:27 tibor.pacalat Resolution open => fixed
2025-10-06 15:05 Mazi Note Added: 83542
2025-10-06 17:03 tibor.pacalat Note Added: 83551