Repository navigation
Conversation
Reject JWE/alg=none in JWTTokenApi, keep TLS 1.2+ defaults from create_default_context, pin patched jwcrypto, and add optional target/connection limits without changing unauthenticated defaults. Co-authored-by: Cursor <cursoragent@cursor.com>
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.
Summary
This is a security hardening pass against v0.13.0. It closes several high-severity issues found in a source review (JWT JWS/JWE confusion, TLS context option overwrite, unpinned jwcrypto with known DoS CVEs,
--libserversilently dropping auth) while keeping unauthenticated / non-TLS operation as the default so existing noVNC setups do not break.Version is bumped to 0.14.0 because of the JWT, TLS, and Python support changes.
High-severity fixes
JWTTokenApiis compact JWS only. Encrypted JWE tokens andalg=noneare rejected. The verification key is markeduse=sig. This is the application-level equivalent of CVE-2022-3102: previously the plugin auto-detected JWE and decrypted with the same key used for signatures, so an RSA/EC private PEM could be abused to injecthost/portclaims.SSLContext.options.create_default_context()hardening is preserved (options |=extra flags only).--ssl-version defaultnow means TLS 1.2 viassl.TLSVersion, instead of assigningssl.OP_ALL(and mixingPROTOCOL_*constants into options).jwcrypto>=1.5.7(closes CVE-2023-6681, CVE-2024-28102, CVE-2026-39373).numpy,requests, andredisnow have minimum versions as well.--libserverno longer nullstoken_plugin/auth_plugin, which previously disabled access control with only a generic “option ignored” print.Other hardening
UnixDomainSocketDirectoryusesPath.resolve()+relative_to()and rejects multi-segment tokens.BasicHTTPAuthuseshmac.compare_digest; credentials and Redis passwords can be read from@/path/to/file.timeout=5and URL-quote the token.TokenRedissupports TLS (optional 6th source field).--allowed-targets(SSRF allowlist for token-resolved backends) and--max-connections(process cap; default0= unlimited).python:3.13-slim-bookwormand runs asUSER websockify.python_requires >= 3.10); CI covers 3.10–3.14.SECURITY.md, Dependabot, and apip-auditworkflow.socketconstants (fixes the DarwinTCP_KEEPIDLEtest failure).Breaking / behavioral changes
JWTTokenApirejects JWE--ssl-version tlsv1_1)jwcrypto>=1.5.7Unauthenticated, non-
--ssl-onlyoperation is unchanged on purpose. Production still needs--ssl-only,--auth-plugin,--allowed-targets, and--max-connections(or a reverse proxy). SeeSECURITY.md.Test plan
nose2— 107 tests passed (including new JWT/JWE,alg=none, frame-size, UDS traversal, allowlist,@fileauth, Redis TLS-flag tests)flake8pip-audit— no known vulnerabilities on installed jwcrypto 1.5.8 / requests 2.34.2 / numpy 2.5.2 / redis 8.1.0JWTTokenApiwith JWE today, confirm you can switch to compact JWS