Repository navigation
fix: HTTPS-only URLs, quieter logs, pipe fail-closed, CI lockstep - #22
Conversation
Reject non-https binding and update URLs; updater denies HTTPS-to-HTTP redirects. Default log_level=info; editor/clipboard previews stay at DEBUG. Named pipe fails closed if SDDL setup fails and accepts only this exe as a client. Tag zip stamps the companion to PE X.Y.Z; CI pins clang-format 18. --help and README match the shipped product. Co-authored-by: Hermes/grok-4.6/m3rcur1al <hermes-m3rcur1al@local>
There was a problem hiding this comment.
Pull request overview
Hardens URL handling, extension IPC, logging defaults, release packaging, and user documentation.
Changes:
- Enforces HTTPS URLs and extension origin allowlisting.
- Reduces sensitive INFO logs and secures named-pipe clients.
- Aligns CI packaging, formatting, help text, and documentation.
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/workflow.cpp |
Validates URLs and quiets capture logs. |
src/util.cpp |
Adds HTTPS URL validation. |
src/updater.cpp |
Prevents insecure feeds and redirects. |
src/main.cpp |
Updates CLI help. |
src/ext_bridge.cpp |
Hardens named-pipe setup and clients. |
src/config.cpp |
Validates configured and CLI URLs. |
src/app.cpp |
Extends self-tests and config guidance. |
scripts/format.sh |
Prefers clang-format 18. |
README.md |
Documents current behavior and paths. |
include/util.hpp |
Declares URL validation API. |
include/config.hpp |
Changes default logging to Info. |
extension/background.js |
Restricts companion navigation origins. |
config/qiuckprompts.ini |
Ships quieter logging defaults. |
.github/workflows/ci.yml |
Pins formatting and stamps packaged extensions. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| { | ||
| std::wstring logPath; | ||
| LogLevel logLevel = LogLevel::Debug; | ||
| LogLevel logLevel = LogLevel::Info; |
There was a problem hiding this comment.
Fixed in f5d5bc7 — after LoadConfigFile we re-apply --log-level (CLI wins) then Logger::SetLevel so AppData log_level is actually used.
| const std::wstring s = Trim(url); | ||
| constexpr wchar_t kPrefix[] = L"https://"; |
There was a problem hiding this comment.
Fixed in f5d5bc7 — IsHttpsUrl now rejects outer whitespace; CLI/INI Trim first and store the trimmed URL.
| const wchar_t host0 = s[kPrefixLen]; | ||
| if (host0 == L'/' || host0 == L'\\' || host0 == L'?' || host0 == L'#') | ||
| return false; | ||
| return true; |
There was a problem hiding this comment.
Fixed in f5d5bc7 — skip userinfo, require host to start with alnum or [. https://:443/path is rejected; https://[::1]/ still ok.
| const std::wstring want = FileLeaf(GetExePath()); | ||
| const std::wstring got = FileLeaf(img); | ||
| return !want.empty() && _wcsicmp(want.c_str(), got.c_str()) == 0; |
There was a problem hiding this comment.
Fixed in f5d5bc7 — compare GetFullPathName of this exe vs client image path (case-insensitive). Same-PID dummy connect still allowed.
After LoadConfigFile, re-apply --log-level and SetLevel so AppData log_level=debug still wins unless CLI overrides. IsHttpsUrl rejects outer whitespace and empty hosts (https://:443/…). CLI stores the trimmed URL. Pipe clients must match this exe's full path, not just the leaf name. Co-authored-by: Hermes/grok-4.6/m3rcur1al <hermes-m3rcur1al@local>
|
Addressed Copilot in f5d5bc7 (4/4):
Self-test rebuilt green. Left open. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 14 out of 14 changed files in this pull request and generated no new comments.
Suppressed comments (1)
src/util.cpp:436
- The bracket branch only checks the first character, so malformed authorities such as
https://[]/andhttps://[/are accepted even though they have no hostname. These values then pass the new config/CLI/workflow guards and fail later during navigation. Validate a non-empty, closed bracketed host (and any following port) before returning true.
const wchar_t host0 = url[i];
if (!(iswalnum(host0) || host0 == L'['))
return false;
return true;
Summary
Hardening from the v1.0.5 architecture/security review (items 1–5). No merge — leave open for Copilot + human.
HTTPS-only URLs
IsHttpsUrlon bindingurl=,default_ai_url,update_url,--ai-url,--update-url, and workflow navigate.WINHTTP_OPTION_REDIRECT_POLICY_DISALLOW_HTTPS_TO_HTTP.prepareAndPaste/preparereject non-https and origins outsidemanifest.jsonhost_permissions.Quieter logs
log_level=info(code + shipped template).CI lockstep
build/RelWithDebInfo/extension(fallback: repo +stamp_extension_version.cmake).CLANG_FORMAT.Pipe fail-closed
GetNamedPipeClientProcessId+ image name must be this exe (tray dummy connect or--native-messaging-host).Docs
--helpand README match shipped hotkeys (J/K/L/I/O/M), AppData config, hidden top-level HWND, https-only URLs.Existing AppData
qiuckprompts.iniis not overwritten. If it still haslog_level=debug, change it locally and restart.Test plan
scripts/build.batDebug compile of all touched .cpp--self-testexit 0 (new cases: default Info,IsHttpsUrlaccept/reject,--ai-urlhttp rejected / https accepted)log_level=debugstill wins until edited