-
Notifications
You must be signed in to change notification settings - Fork 83
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
Some security issues #270
Comments
Ah, and also... I would suggest to have an optin for modules. In GUI. That would allow users to install module for OpenVPN, custom Wireguard settings, etc. |
Reading the source, it appears to be downloading a shared binary object - The purpose of this library is referenced here. It is not clear why this library is downloaded on boot instead of being included. In any case, it's very insecure - since if an attacker gains control of the endpoint they can place malware in the shared binary. These binary sources should be at least be checked to ensure they match a specified hash sum; but ideally, these binaries could just be included in the release. |
This is already done in the latest version. If you login to the web interface you get at notification to set the password. If you change the password the ssh password will also be changed.
This is required by the server to generate the downloaded libmaixcam_lib.so which is locked to work only on this device. Which is also the reason why it is not included in the image.
If you follow the link which devoxel already mentioned, you find a fully functional open source replacement. I do not know why Sipeed still prefers to ship a dongled version, there is no secret inside anymore :-) |
So, if I understand this Well, I would be really happy if someone would make a truly opensource version of this, based on this Debian port and code mentioned here. |
No, libmaixcam_lib.so can be replaced with this: This variant is truly open source: |
I investigated the download of This is also the endpoint that receives you If you want to test this, use the following command: (Linux, add curl "https://maixvision.sipeed.com/api/v1/nanokvm/encryption?uid=<YOUR DEVICE KEY>" -H "token: MaixVision2024" -o libmaxicam_lib.so Depending on your device key, this file differs. This means, each user will get a unique shared object. I verified this using checksums. This is very weird. If you want to verify this, here is a list of device keys, which I guessed by comparing two device keys of NanoKVM's:
I'm not into reverse engineering (RISC-V) Linux stuff. Maybe someone wants to investigate this further. The ELF header with |
Thank you for raising these questions. Enhancing security will be our primary focus in the upcoming development phases. The issue with libmaixcam_lib.so is a legacy matter. We reused code from our previous project (MaixCAM), which is why this dependencie is still present. |
A brief response to the above questions:
Now we prompt users to change their passwords. And the changed password will apply to both web and SSH access. We are also considering disabling SSH access by default.
This
Enabling CSRF may cause api unavailability in some cases. We will fix this issue.
The JWT token key is dynamically generated upon each service restart, therefore, all existing logins will be invalidated.
This is bug and we will fix it.
To download libmaixcam_lib.so, please refer to my previous comment.
we will fix it.
To download libmaixcam_lib.so.
We will optimize these issues later. |
Great! I think this is a great product and I am glad it will be even better. |
Why is the device key required to download? |
Device key verification is required before downloading. An incorrect key will prevent the download. |
Right - I'm asking why? |
This device is really great, however there is a lot of work for security improvement. I completely understand that this is not a priority right now - first are usability and performance issues - but I hope developers will address these issues soon.
Here are some problems (this is not a complete list, just a quick observation).
If no account configuration file is found, it defaults to a predefined admin account (admin/admin). Better solution would be, that when you run the NanoKVM the first time, you would need to set up it - and set strong password.
By default
ssh
is enabled, and has defaultroot
password (root
). Better solution would be to enablessh
via web interface and set initial password there.EncryptSecretKey
is hardcoded for all "encrypt" operations.There is no CSRF protection on websocket and API endpoints.
Auth token does not have refresh call, TTL is 30 days.
User can not invalidate session (if session gets stolen).
There is a lot of cases where developers decided to use sleep function between operations. The problem is, that it is possible that there could be situations, where the previous operation does not end in the sleep time. This can lead to weird and unpredictable situations.
Why is NanoKVM sending your device key to the Sipeed?
Network problems. Some users are using their own Wireguard servers (see issue here). This works, however I found out that the Wireguard version on NanoKVM does not work in some networks with more restricted frirewalls. In my company they have some restrictions in place (at least I know that they are blocking 3rd party DNS servers), and NanoKVM does not work there. I mean, it works, but only locally, and can not connect to the internet (i. e. can not check for updates), and Wireguard is also not working. On the other hand, Wireguard version on my computer works fine.
NanoKVM is coneccting (and presumalby downloading something) from here:
https://wiki.sipeed.com/maixvision
. Why?NanoKVM has
tcpdump
andaircrack
installed. (Seee issue here. I understand that is needed for development, but for production version sounds bad.Download code (for updates) does not check the integrity, it just downloads zip file.
API is running as root. My suggestion would be to isolate this as well...
Device uses some "custom" DNS servers and it is quite hard for users to change that... There should be network settings in the web GUI with all the transparent information. Also, option to use proxy would be nice.
This is not an exhaustive list, just some random observations, which show, that there needs to be done a lot in the area of security.
Also, I would suggest that instead of current Linux version you use this port of Debian. It is using
apt
(so you can normally install software - for instance right now there is no OpenVPN package on the device),systemd
(so you can run services normally), etc.My suggestion would be to help this developer with porting Debian to NanoKVM board (basically it is just
SG200x board
) and cooperate with Debian so thatSG200x boards
would be officially supported by Debian. That will increase trust in devices, make them much more usable and also lower the cost of development (because underlying Linux would be supported by community).Also, it would be nice to have some security review of RISC-V CPU (like this one), but OK, I understand this is a little out of the scope at this point.
The text was updated successfully, but these errors were encountered: