Repository navigation
Conversation
rokogan
force-pushed
the
security-hardening
branch
from
November 26, 2026 03:40
c55bb92 to
4bad81f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Security hardening from the project review.
Device token
GET /api/configno longer returns the token; it reportshasTokeninstead. Saving the config keeps the saved token unless the request sets one. An empty one turns token auth off. The web UI and the installer never need to see it.POST /api/tokengenerates a 128-bit token from the system's cryptographic generator and applies it at once.tv-config.jsonis readable only by SYSTEM and administrators. The restriction is applied on every save (before the file is renamed into place) and at start, so installs from earlier versions are fixed too.install.ps1generates a token only when the service has none. Previously it replaced the token on every run, which would lock out other TVs.WebSocket
Originishttporhttpsare refused, so a web page can no longer drive the PC in open mode, in a browser on the LAN or on this PC. The TV app is a localfile://app and sendsnull,file://or noOrigin. Only web origins are refused, not unknown ones, so an unexpected value from the TV can't lock it out.Firewall
installsays so, andinstall.ps1warns about any network Windows treats as Public.Testing
cargo fmt --check,cargo clippy --all-targets -- -D warningsandcargo testpass: 54 unit tests and 8 integration tests. New tests cover:https/httprefused;file://andnullaccepted);GET /api/confighides the token;POST /api/tokenwrote a new 32-hex token and kept the rest of the config.install.ps1parses in Windows PowerShell 5.1.Not tested here:
netshrule syntax, and the file permissions applied when running as SYSTEM. Both need an elevated install.Origin. If the TV were ever refused, Recent Events names the origin it used.