fix(webhooks): Ignore the local-webhook escape hatch on mainnet and read it through one helper
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 78/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- rust
- Domain
- backend-api-design, security
Research direction
Start with the two environment variable reads in crates/webhooks/src/lib.rs and the startup checks and tests in bin/server/src/mainnet_guard.rs. Trace how the server determines whether it is on mainnet, then read the related documentation in docs/environment-variables.md and docs/threat-model.md. Done means one helper serves both reads, startup rejects the override on mainnet with a test, and both docs explain the development and tests only restriction.
Written by the indexing model from the issue text.
Description
Description
OCTO_ALLOW_LOCAL_WEBHOOKS=1 disables the SSRF guard entirely and is read in two places in crates/webhooks/src/lib.rs (around lines 398 and 482). Nothing stops it from being set in production, and it is not in docs/environment-variables.md.
Requirements and context
- Where:
crates/webhooks/src/lib.rs,bin/server/src/mainnet_guard.rs,docs/environment-variables.md - Security: This variable turns off SSRF protection; on mainnet it must be impossible to enable by accident.
- Testing:
just fmt-check,just lintandjust testmust pass; add or update tests for the change. - Documentation: Document in
docs/environment-variables.mdanddocs/threat-model.md.
Suggested execution
- Comment on this issue to claim it, then fork the repository and branch from
main. - Branch name:
git checkout -b fix/webhooks-allow-local-mainnet
Implement changes
- Add one
allow_local_webhooks()helper and use it at both read sites. - Refuse to start on mainnet when the variable is set (add a message to
mainnet_guard.rs). - Document the variable as 'development and tests only'.
Test and commit
- Add a
mainnet_guardtest: variable set + mainnet = configuration error. - Run
just fmt,just lintandjust testlocally before pushing (seeCONTRIBUTING.md). - Commit with a conventional message and keep the change small and focused.
Example commit message
fix(webhooks): forbid local webhook override on mainnet
Guidelines
- Open the PR against
mainand link it withCloses #<this issue>. - Keep the diff focused on this issue; no unrelated refactors or formatting churn.
- One line per comment, no bloated code; follow patterns already used in the crate.
- Never commit secrets,
.envfiles or real keys; use public test vectors only. - CI (fmt, clippy
-D warnings, tests) must be green before requesting review. - Ask in the issue thread if anything is unclear before starting.
- Dominant language
- Rust
- Stars
- 0
- Forks
- 91
- Avg merge
- 5h 23m
- Merged PRs (30d)
- 4
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Octo-Protocol-org/Octo-Protocol
-
area/integration area/testing enhancement good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area/integration area/testing enhancement good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area/integration area/testing enhancement good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area/integration area/testing enhancement good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
area/integration area/testing enhancement good first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Octo-Protocol-org/Octo-Protocol#701 · 1 comment ·
All issues in Octo-Protocol-org/Octo-Protocol
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
bug rust
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 2 days
-
type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 67/100
franciscoBSalgueiro/en-croissant#1111 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
oxc-project/oxc-htmlish-parser#34 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
longbridge/nsh#2541 ·
Maintainers usually reply within 1 day