Skip to content

fix(input): strip a UTF-8 byte order mark from the first line of a target list - #8429

Open
hakarrr wants to merge 2 commits into
projectdiscovery:devfrom
hakarrr:fix-list-input-strip-bom
Open

hakarrr wants to merge 2 commits into
projectdiscovery:devfrom
hakarrr:fix-list-input-strip-bom

Conversation

@hakarrr

@hakarrr hakarrr commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

A target list saved with a UTF-8 byte order mark loses its first target: it is counted in "Targets loaded" but never requested, with no error. scanInputFromReader passed the first line to addInput with the BOM (U+FEFF) still attached, which made the target invalid.

Fix: trim a leading U+FEFF from the first line only.

Test: TestScanInputFromReaderStripsByteOrderMark loads a BOM-prefixed list and checks both targets come out. It fails before the fix and passes after. go test ./pkg/input/... passes.

Closes #8428

hakarrr and others added 2 commits December 2, 2026 11:12
…rget list

A BOM at the start of a -l list stayed attached to the first target, which made it invalid and silently dropped it. Trim a leading U+FEFF from the first line. Closes projectdiscovery#8428.

Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
Closes projectdiscovery#8428.

Co-authored-by: GeneralTony007 <144252170+GeneralTony007@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Dec 2, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

This review ran on the open-source allowance, not this organization's plan, because the pull request author doesn't have an assigned seat. Waiting won't change this — ask an organization admin to assign them a seat, or add seats in Billing if every seat is already assigned, then retry.

Next included review available in 19 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 10 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7c266c46-b4df-4565-ac2d-b96bd74ebe2c
Commits

Reviewing files that changed from the base of the PR and between e121fe2 and b96c05e.

Files selected for processing: 2

  • pkg/input/provider/list/bom_test.go
  • pkg/input/provider/list/hmap.go
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

nuclei -l silently drops the first target when the list file starts with a UTF-8 BOM

1 participant