mirror of
https://github.com/motioneye-project/motioneye.git
synced 2026-03-02 22:57:06 -05:00
Exposing admin username in javascript could be a potential security risk #2098
Labels
No labels
Android app
Arch Linux
CI/CD
CSS
FreeBSD
HTML/HTTP
Home Assistant addon
JavaScript
Python
Raspberry Pi
Stale No Activity 60 Days
bug
code format
dependencies
dev branch
docker
documentation
duplicate
enhancement
feature
help wanted
i18n/l10n
invalid
legacy motionEye
meta
motion
motionEyeOS
notourproblem
python update
question
question
security
troubleshooting
wontfix
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/motioneye#2098
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @developerfromjokela on GitHub (Dec 28, 2021).
Hello!
motionEye seems to expose admin username in its HTML as javascript variable.
I think this is a potential security risk for brute-force and/or dictionary attacks towards the login system.
What was/is purpose of keeping that variable in HTML?
@G2G2G2G commented on GitHub (Feb 4, 2022):
This has nothing to do with brute force or dictionary attacks in any way.
data logging/sniffing/reading sure
@developerfromjokela commented on GitHub (Feb 4, 2022):
It has. If you don't expose your username, they cannot login even if they had correct password.
@developerfromjokela commented on GitHub (Feb 4, 2022):
It makes that job easier
@MichaIng commented on GitHub (Mar 18, 2022):
It is the way how it is passed from the backend to browser's JavaScript to check whether the current user is the admin user, to show/hide enable/disable certain GUI elements:
github.com/motioneye-project/motioneye@c7d86c6/motioneye/templates/main.html (L89)github.com/motioneye-project/motioneye@4249e44/motioneye/static/js/main.js (L398)However, I agree this is not so awesome. The admin username cannot be changed via GUI, but at least manually via config file. Since it is not used anywhere else in the frontend, it makes more sense to pass an "isAdmin" flag instead of the name. Even smarter would be to apply an admin or non-admin class to admin-only HTML elements right with the backend to have them shown/hidden in the first place, without needing to toggle classes via JavaScript, making even passing this flag obsolete.