Repository navigation
Security: load GPU libraries by full path, keep web pages off the local API, pin CI - #82
Conversation
…al API, pin CI The service may run as administrator from a folder the user's programs can write to. It loaded nvml.dll for the GPU's sensors by its bare name, so on a PC without NVIDIA's driver Windows also looked beside camless and in every folder on the PATH. It now loads it by full path from the directory GetSystemDirectoryW names, as the GPU fan code already did from %SystemRoot%, and atiadlxx.dll the same way. The local API answers 403 to a request a browser sends for a page elsewhere: an Origin other than its own address, or Sec-Fetch-Site other than same-origin or none. /v1/history answers 400 to times out of range. CI and the release workflow pin each action to a commit, keep the token out of the checkout, pass the tag through the environment and build with --locked. Dependabot proposes newer actions once a month. rustix goes to 1.1.6 (RUSTSEC-2026-0486; camless does not call the affected functions). Co-Authored-By: Claude <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
@coderabbitai review AI agent on behalf of kleju13 |
Action performed
|
What changes
A security pass over the repo. camless's service may run as administrator, from a folder the user's own programs can write to, and it has a local API that any browser tab can send requests at. This closes what the pass found in the code and in the build.
nvml.dllfor the GPU's sensors by its bare name. On a PC without NVIDIA's driver, Windows then also looked beside camless and in every folder on the PATH, and the service would have loaded a DLL found there as administrator. It now loads it from the directoryGetSystemDirectoryWnames, or from NVSMI on old drivers. The GPU fan code already used a full path, built from%SystemRoot%; it shares the new function, and so doesatiadlxx.dll. A variable is whatever the user's programs set it to.Originother than the API's own address, or withSec-Fetch-Siteother thansame-originornone, is turned away. Until now theHostcheck and the content types did this job alone. The app, the MCP server,camless reportand the installer send neither header. An address typed into a browser still works; a link to the API on a web page gets the 403./v1/historyanswers 400 to times out of range.span,fromandtomust be within0..=99_999_999_999.--locked, so a release is built from the versions inCargo.lock. Dependabot proposes newer actions once a month.docs/how-it-works.mdhas the new rules, and says that the API has no password.One thing to know: with
--locked, CI fails when a version bump leavesCargo.lockbehind.Testing
cargo test --workspace --release --lockedon Linux: 179, 36 and 25 tests pass.cargo test --workspace --lockedforx86_64-pc-windows-gnuunder Wine: 168, 36 and 27. Two tests are new: one for the Origin rule, one for the System32 path. The history test has the out-of-range cases.The demo service on Linux, with curl: a program's GET 200, the API's own origin 200,
Sec-Fetch-Site: none200, a page elsewhere 403 (with CORS, without, and from another port of the same PC), a foreignHost421, a negativefrom400, a cross-sitePOST /v1/stop403, the same from a program 202 and the service stopped.The action commits were read from GitHub and checked against their tags.
On a Windows 11 PC with an RTX 4070 SUPER, a build of this branch:
camless sensorsreads the GPU's temperature, load and power, the same as 0.6.0-beta.5. With a wrongnvml.dllput beside the exe, this build still reads all three. The 0.6.0-beta.5 exe in the same folder loads the wrong one and loses GPU power.Not tested:
atiadlxx.dllon a PC with an AMD card. The release workflow runs only for a tag, so its changes first run with the next release.AI agent on behalf of kleju13
🤖 Generated with Claude Code
Summary by CodeRabbit