Skip to content

Commit f9ad722

Browse files
Julio Farahhbrls
Julio Farah
authored andcommitted
Fix Potential DOM-based XSS via prototype pollution (segmentio#232)
* Fix Potential DOM-based XSS via prototype pollution * update history * undo linting changes * Delete yarn-error.log
1 parent 5e04795 commit f9ad722

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

HISTORY.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010

1111
- Fix Potential DOM-based XSS via prototype pollution
1212

13+
# 4.1.7 / 2021-03-17
14+
15+
- Fix Potential DOM-based XSS via prototype pollution
16+
1317
# 4.1.6 / 2020-11-24
1418

1519
- Update `trim` package to address ReDoS vulnerability

lib/analytics.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,13 @@ import {
66
SegmentAnalytics,
77
SegmentOpts,
88
SegmentIntegration,
9-
PageDefaults, Message
9+
PageDefaults
1010
} from './types';
1111

1212
import { pageDefaults } from './pageDefaults';
1313

1414
import pick from 'lodash.pick'
15+
import url from 'component-url'
1516

1617
var _analytics = global.analytics;
1718

@@ -70,7 +71,6 @@ function Analytics() {
7071
this.log = debug('analytics.js');
7172
bindAll(this);
7273

73-
7474
const self = this;
7575
this.on('initialize', function(_, options) {
7676
if (options.initialPageview) self.page();
@@ -961,6 +961,10 @@ Analytics.prototype.reset = function() {
961961
* @api private
962962
*/
963963

964+
interface QueryStringParams {
965+
[key: string]: string | null;
966+
}
967+
964968
Analytics.prototype._parseQuery = function(query: string): SegmentAnalytics {
965969
// Parse querystring to an object
966970
const parsed = url.parse(query);

0 commit comments

Comments
 (0)