Repository navigation
Require a PIN for web import and limit request size - #15
Merged
Merged
Conversation
The web import server accepted uploads and provider credentials from anyone on the LAN, read request bodies of any size, served unlimited concurrent connections, and only checked that a config contained "[Interface]". - Writes need a 6-digit PIN shown on the TV next to the address. It is new each time the server starts; five wrong guesses lock it for 60 s. - Requests over 64 KB or without Content-Length are rejected before the body is read. - At most 4 connections are served at once; extra ones are closed. - Uploaded configs must parse with the WireGuard Config parser, and profile names are capped at 80 characters. Traffic is still plain HTTP; SECURITY.md says so. Fixes #8, fixes #9 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # SECURITY.md
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.
Locks down the LAN web importer.
X-UniVPN-PIN.Config.parse; names capped at 80 charsTraffic is still plain HTTP, so someone watching LAN traffic can read what's submitted. SECURITY.md and the README now describe the PIN and that limitation.
Testing
Unit:
PinGuardTest(5 tests: accept, reject, lockout and expiry, reset on success, PIN format).On the Android TV emulator (PIN read from the Profiles screen, port forwarded, requests with curl):
Not a valid WireGuard config: SYNTAX_ERROR in INTERFACE TOP_LEVELThe page's script passes
node --check. I didn't drive the form in a real browser; the requests above match what it sends.🤖 Generated with Claude Code