Skip to content

fix(security)!: WP_ALLOW_HTTP names hosts instead of switching the rule off (3.9.5) - #23

Merged
BenKalsky merged 2 commits into
mainfrom
fix/scope-http-hatch
Sep 13, 2026
Merged

BenKalsky merged 2 commits into
mainfrom
fix/scope-http-hatch

Conversation

@BenKalsky

Copy link
Copy Markdown
Member

From the ClawHub audit of 3.9.4. AIG rated this High, and the rating is right.

The hatch was scoped to a decision, implemented as a global

WP_ALLOW_HTTP=1 meant any host. The decision it was meant to express is "I accept plaintext for this staging box"; what it actually did was switch the rule off for every site the agent touched afterwards — production included, with a reusable application password on the wire each time.

Exported in a shell profile or a cloud environment, it would never be noticed again.

blanket =1         -> refused: name the host(s) instead, e.g. WP_ALLOW_HTTP=staging.example.com
named host         -> ALLOWED (warned)
named, other host  -> refused: (Set WP_ALLOW_HTTP=prod.example.com to send them to THIS host anyway.)
list of two        -> ALLOWED (warned)
REQUIRE_HTTPS wins -> refused: (WP_REQUIRE_HTTPS=1 is set - refusing.)
localhost          -> ALLOWED
https              -> ALLOWED

A refusal names the host you would have to allow, so the hint is actionable for that site rather than for all of them — and WP_REQUIRE_HTTPS=1 no longer suggests the hatch it overrides, which would just fail again.

BREAKING: WP_ALLOW_HTTP=1 stops working. Replace it with the hostname.

What I did not change, and why

The audit also flags requirements.txt as unpinned (Low): requests>=2.32.3,<3 lets separate installs resolve to artifacts that were not audited.

I am leaving it a range. An exact or hash pin stops users receiving patch-level security fixes for the very dependency whose advisory is the reason for the lower bound, and this skill ships no lockfile-refresh process to compensate — a pinned requests here would rot. The trade is reproducibility for patchability, and it is now written into SKILL.md where the next auditor meets it rather than argued once in a PR.

Tests: 124 → 128.

🤖 Generated with Claude Code

…le off (3.9.5)

WP_ALLOW_HTTP=1 meant 'any host'. One variable exported for one plaintext
staging box silently covered every site the agent touched afterwards -
production included, with a reusable application password on the wire. AIG
rated it High on the 3.9.4 audit and that is the right rating: the hatch I
added in 3.9.0 was scoped to the decision ('I accept http here') but
implemented as a global ('http is fine everywhere').

It now names the hosts it permits, comma-separated. A blanket value is refused
with the exact string to write instead, and an ordinary refusal names the host
you would have to allow - the hint is actionable for that site rather than for
all of them. WP_REQUIRE_HTTPS=1 still overrides the list, and stops suggesting
the hatch it overrides.

BREAKING CHANGE: WP_ALLOW_HTTP=1 no longer works. Use the hostname.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@BenKalsky

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 12, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-13T00:05:12.957064Z 69705af Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2681a3032d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

print("SECURITY WARNING: " + msg + " (WP_ALLOW_HTTP=1 set - continuing.)", file=sys.stderr)
raw = env.get("WP_ALLOW_HTTP") or ""
allowed = {item.strip().lower() for item in raw.split(",") if item.strip()}
if allowed & {"1", "true", "yes", "all", "*"}:

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P3 Badge Check WP_REQUIRE_HTTPS before suggesting a named host

When an upgraded environment retains the legacy WP_ALLOW_HTTP=1 while also setting WP_REQUIRE_HTTPS=1, this blanket-value branch runs first and tells the operator to replace 1 with a hostname. That suggested change still cannot work because WP_REQUIRE_HTTPS overrides the allowlist, contrary to the intended actionable diagnostic in the following branch; check the strict setting first so the refusal identifies the policy that must actually be addressed.

Useful? React with 👍 / 👎.

…t cannot help

With a legacy WP_ALLOW_HTTP=1 still set alongside WP_REQUIRE_HTTPS=1, the
blanket-value branch fired first and told the operator to replace 1 with a
hostname - advice that cannot work, because WP_REQUIRE_HTTPS overrides the
allowlist either way. Strictness is checked first now, so the refusal names
the setting that has to change.

Same rule I applied to the named-host branch in this PR and did not carry
across to the blanket one.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@BenKalsky

Copy link
Copy Markdown
Member Author

Fixed. With a legacy WP_ALLOW_HTTP=1 still set alongside WP_REQUIRE_HTTPS=1, the blanket branch fired first and told the operator to write a hostname — advice that cannot work, since WP_REQUIRE_HTTPS overrides the allowlist either way.

This is the same rule I applied to the named-host branch earlier in this PR and then did not carry across to the blanket one: a refusal must name the setting that actually has to change. Strictness is checked first now, with a test pinning the message for exactly that combination.

129 tests.

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. 🚀

Reviewed commit: 69705af20d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@BenKalsky
BenKalsky merged commit bd93a1d into main Sep 13, 2026
3 checks passed
@BenKalsky
BenKalsky deleted the fix/scope-http-hatch branch September 13, 2026 00:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant