Skip to content

Commit b8a1f11

Browse files
committed
Merge branch 'master' into next
# Conflicts: # CHANGELOG.md # package-lock.json
2 parents 6f40c67 + b4568cc commit b8a1f11

File tree

17 files changed

+1540
-2774
lines changed

17 files changed

+1540
-2774
lines changed

.github/workflows/main.yml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,13 @@ jobs:
280280
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -O /tmp/chrome.deb
281281
apt install -y /tmp/chrome.deb
282282
283+
- name: Install Sharp dependencies for image processing
284+
shell: bash
285+
run: |
286+
export DEBIAN_FRONTEND=noninteractive
287+
apt-get update -y
288+
apt-get install -y libvips-dev
289+
283290
- name: Copy code
284291
shell: bash
285292
run: |
@@ -338,8 +345,8 @@ jobs:
338345
working-directory: /opt/countly/ui-tests/cypress
339346
run: |
340347
ARTIFACT_ARCHIVE_NAME="$(date '+%Y%m%d-%H.%M')_${GITHUB_REPOSITORY#*/}_CI#${{ github.run_number }}_${{ matrix.test_type }}.tar.gz"
341-
mkdir -p screenshots videos
342-
tar zcvf "$ARTIFACT_ARCHIVE_NAME" screenshots videos
348+
mkdir -p screenshots videos downloads
349+
tar zcvf "$ARTIFACT_ARCHIVE_NAME" screenshots videos downloads
343350
curl -o /tmp/uploader.log -u "${{ secrets.BOX_UPLOAD_AUTH }}" ${{ secrets.BOX_UPLOAD_PATH }} -T "$ARTIFACT_ARCHIVE_NAME"
344351
345352
ui-test-sdk:

CHANGELOG.md

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,38 @@
22
Dependencies:
33
- Remove SQLite
44

5+
## Version 25.03.xx
6+
Fixes:
7+
- [push] Fixed timeout setting
8+
- [security] Fixed injection possibility on res.expose
9+
10+
Enterprise Fixes:
11+
- [groups] Add logs for user updates
12+
- [surveys] Change question map log to debug log
13+
14+
Enterprise Fixes:
15+
- [data-manager] Fixed bug when merging events with ampersand symbol in the name
16+
17+
Dependencies:
18+
- Bump axios from 1.12.2 to 1.13.1 in /plugins/cognito
19+
- Bump csvtojson from 1.1.12 to 2.0.14
20+
- Bump eslint-plugin-vue from 10.5.0 to 10.5.1
21+
- Bump express-rate-limit from 8.1.0 to 8.2.0
22+
- Bump get-random-values from 4.0.0 to 4.1.0
23+
- Bump lint-staged from 16.2.4 to 16.2.6
24+
- Bump mockttp from 4.2.0 to 4.2.1 in /plugins/crash_symbolication
25+
- Bump nodemailer from 7.0.9 to 7.0.10
26+
- Bump puppeteer from 24.25.0 to 24.27.0
27+
- Bump vite from 7.1.10 to 7.1.12
28+
529
## Version 25.03.25
630
Fixes:
731
- [crashes] Fixed resolving audit log recording
832
- [location] Fixed updating none gps coordinate location after gps location was used
9-
-
33+
1034
Enterprise Fixes:
1135
- [ab-testing] Add script for fixing variant cohort
1236
- [groups] Fix user permission update after updating user group permission
13-
1437
## Version 25.03.24
1538
Fixes:
1639
- [jobs] Fix condition for scheduling alert job

bin/scripts/device_list/package-lock.json

Lines changed: 10 additions & 41 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bin/scripts/device_list/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,6 @@
2323
},
2424
"homepage": "https://count.ly/",
2525
"dependencies": {
26-
"csvtojson": "^1.1.9"
26+
"csvtojson": "^2.0.13"
2727
}
2828
}

frontend/express/app.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,8 +438,10 @@ Promise.all([plugins.dbConnection(countlyConfig), plugins.dbConnection("countly_
438438
next();
439439
});
440440

441-
app.use('*.svg', function(req, res, next) {
442-
res.setHeader('Content-Type', 'image/svg+xml; charset=UTF-8');
441+
app.use(function(req, res, next) {
442+
if (req.path.endsWith('.svg')) {
443+
res.setHeader('Content-Type', 'image/svg+xml; charset=UTF-8');
444+
}
443445
next();
444446
});
445447

frontend/express/libs/express-expose.js

Lines changed: 26 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ function renderNamespace(str) {
157157
function renderObject(obj, namespace) {
158158
return Object.keys(obj).map(function(key) {
159159
var val = obj[key];
160-
return namespace + '["' + key + '"] = ' + string(val) + ';';
160+
return namespace + '["' + escape_js_string(key) + '"] = ' + string(val) + ';';
161161
}).join('\n');
162162
}
163163

@@ -180,61 +180,49 @@ function string(obj) {
180180
}
181181
else if ('[object Object]' === Object.prototype.toString.call(obj)) {
182182
return '{' + Object.keys(obj).map(function(key) {
183-
return '"' + key + '":' + string(obj[key]);
183+
return '"' + escape_js_string(key) + '":' + string(obj[key]);
184184
}).join(', ') + '}';
185185
}
186186
else {
187-
obj = escape_html(JSON.stringify(obj));
187+
obj = JSON.stringify(obj);
188188
if (obj) {
189+
// Only escape things that could break out of script context
189190
obj = obj.replace(/<\/script>/ig, '</scr"+"ipt>');
191+
obj = obj.replace(/<!--/g, '<\\!--');
192+
obj = obj.replace(/\u2028/g, '\\u2028'); // Line separator
193+
obj = obj.replace(/\u2029/g, '\\u2029'); // Paragraph separator
190194
}
191195
return obj;
192196
}
193197
}
194198

195-
var matchHtmlRegExp = /[<>]/;
196-
197199
/**
198-
* Escape special characters in the given string of html.
200+
* Escape special characters that could break JavaScript string context
199201
*
200-
* @param {string} str - The string to escape for inserting into HTML
202+
* @param {string} str - The string to escape
201203
* @return {string} escaped string
202204
* @public
203205
*/
204-
function escape_html(str) {
205-
str = '' + str;
206-
var match = matchHtmlRegExp.exec(str);
207-
208-
if (!match) {
206+
function escape_js_string(str) {
207+
if (typeof str !== 'string') {
209208
return str;
210209
}
211210

212-
var escape;
213-
var html = '';
214-
var index = 0;
215-
var lastIndex = 0;
216-
217-
for (index = match.index; index < str.length; index++) {
218-
switch (str.charCodeAt(index)) {
219-
case 60: // <
220-
escape = '&lt;';
221-
break;
222-
case 62: // >
223-
escape = '&gt;';
224-
break;
225-
default:
226-
continue;
227-
}
228-
229-
if (lastIndex !== index) {
230-
html += str.substring(lastIndex, index);
231-
}
232-
233-
lastIndex = index + 1;
234-
html += escape;
235-
}
236-
237-
return lastIndex !== index ? html + str.substring(lastIndex, index) : html;
211+
return str
212+
.replace(/\\/g, '\\\\') // Backslash
213+
.replace(/"/g, '\\"') // Double quote
214+
.replace(/'/g, "\\'") // Single quote
215+
.replace(/`/g, '\\`') // Backtick (template literal)
216+
.replace(/\$/g, '\\$') // Dollar sign (template literal)
217+
.replace(/\n/g, '\\n') // Newline
218+
.replace(/\r/g, '\\r') // Carriage return
219+
.replace(/\t/g, '\\t') // Tab
220+
.replace(/\f/g, '\\f') // Form feed
221+
.replace(/\v/g, '\\v') // Vertical tab
222+
.replace(/\0/g, '\\0') // Null character
223+
.replace(/[\u0000-\u001F\u007F-\u009F]/g, function(ch) {
224+
return '\\u' + ('0000' + ch.charCodeAt(0).toString(16)).slice(-4);
225+
});
238226
}
239227

240228
exports = module.exports = function(app) {

0 commit comments

Comments
 (0)