Bug report: Defang URL changes "http" inside hostnames and paths

Open
#2,893 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@rpsirois is already working on this.

Since Oct 16, 2026.

  • #2894 by @rpsirois — open

Assessment

Difficulty
2/5
Estimated time
Under an hour
Newbie friendliness
15/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
javascript
Domain
tooling

Research direction

The bug is in DefangURL.mjs, where a global case-insensitive replace of "http" also rewrites hostnames and paths; start by reading that replace call. Done means the scheme alone is defanged while hostnames and paths keep their original text, checked with the input from the report. A pull request (#2894) is already open against this issue, so coordinate with it before writing a competing change.

Written by the indexing model from the issue text.

Description

bug

Describe the bug
Defang URL replaces every "http" with "hxxp", not just the scheme.

To Reproduce
Input https://httpbin.example.com/http/get with default arguments.
Output: hxxps[://]hxxpbin[.]example[.]com/hxxp/get

Expected behaviour
Output: hxxps[://]httpbin[.]example[.]com/http/get

Additional context
Caused by url.replace(/http/gi, "hxxp") in DefangURL.mjs. PR to follow.

Screenshot
Image

Dominant language
JavaScript
Stars
36.4k
Forks
4.2k
Avg merge
1d 22h
Merged PRs (30d)
14

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from gchq/CyberChef

All issues in gchq/CyberChef

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.