Empowering People Ethically with the leading open source alternative to Google Analytics that gives you full control over your data. Matomo lets you easily collect data from websites & apps and visualise this data and extract insights. Privacy is built-in. Liberating Web Analytics. Star us on Github? +1. And we love Pull Requests!
this.getCookie('namespace.abc') finds cookies using /(^|;)[ ]*_pk_namespace.abc.3.1fff=([^;]*)/. That matches slightly different cookies like _pk_namespaceEabcE3E1fff=value. Other regex metacharacters could break in worse ways.
What happened?
this.getCookie('namespace.abc')
finds cookies using/(^|;)[ ]*_pk_namespace.abc.3.1fff=([^;]*)/
. That matches slightly different cookies like_pk_namespaceEabcE3E1fff=value
. Other regex metacharacters could break in worse ways.Related code: https://github.com/matomo-org/matomo/blob/92a56901b303155d1197f2e5bfd4596204f76b88/js/piwik.js#L6154-L6155 https://github.com/matomo-org/matomo/blob/92a56901b303155d1197f2e5bfd4596204f76b88/js/piwik.js#L3265-L3269 https://github.com/matomo-org/matomo/blob/92a56901b303155d1197f2e5bfd4596204f76b88/js/piwik.js#L2476
What should happen?
Use a non-regex implementation for parsing cookies, or throw an error if cookieName parameter contains unsafe characters, or escape them
How can this be reproduced?
Matomo version
5.0.2
PHP version
No response
Server operating system
No response
What browsers are you seeing the problem on?
No response
Computer operating system
No response
Relevant log output
No response
Validations