Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DB] Potential Bug: sending NULL via umami.trackView(String, NULL) #649

Closed
foxytocin opened this issue May 5, 2021 · 2 comments · Fixed by #694
Closed

[DB] Potential Bug: sending NULL via umami.trackView(String, NULL) #649

foxytocin opened this issue May 5, 2021 · 2 comments · Fixed by #694
Labels
bug Something isn't working

Comments

@foxytocin
Copy link
Contributor

foxytocin commented May 5, 2021

It is possible to accidentally write NULL to the database. Did so accidentally for [referrer] value.

umami.trackView(url, [referrer])

Usage:
umami.trackView('/home', NULL);

When displaying the details page with the referrer statistics in the browser, this leads to the following error
Browser: 'An unexpected error has occurred.'
Console:

Fantastic project, best regards

@mikecao mikecao added the bug Something isn't working label May 5, 2021
@mikecao
Copy link
Collaborator

mikecao commented May 5, 2021

That's def a bug, we should guard against that.

foxytocin added a commit to foxytocin/umami that referenced this issue May 6, 2021
prevents crashes if NULL is entered as a referrer in the database. Does not guard against submitting NULL to the database.
@foxytocin
Copy link
Contributor Author

foxytocin commented May 6, 2021

Made a PR to fix the issue by checking also against ref !== null so that the illegal access of property startsWith doesn't happend. Works fine for the detailed view of the dashboard but doesn't guard against entering null to the DB.

Error case:

foxytocin added a commit to foxytocin/umami that referenced this issue May 6, 2021
as refFilter, urlFilter is expanded checking agains url !== null.
mikecao added a commit that referenced this issue May 13, 2021
Enhancement of issue #649: also checking agains NULL in urlFilter
@mikecao mikecao mentioned this issue Jun 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants