Skip to content

fix source leaks - #1801

Merged
dogancanbakir merged 2 commits into
devfrom
source-leaks
Jul 1, 2026
Merged

dogancanbakir merged 2 commits into
devfrom
source-leaks

Conversation

@Mzack9999

@Mzack9999 Mzack9999 commented Jun 25, 2026 •

Copy link
Copy Markdown
Member

crtsh now closes its db cursor and the github source returns after the rate-limit retry instead of decoding a discarded body

Closes #1800

Summary by CodeRabbit

  • Bug Fixes
    • Improved cleanup of database query results to help prevent resource leaks.
    • Fixed GitHub enumeration behavior so rate-limit responses are handled more reliably and processing stops correctly after a retry.

@coderabbitai

coderabbitai Bot commented Jun 25, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 628c116b-8829-4e90-9ee0-32a6764fe9ca

📥 Commits

Reviewing files that changed from the base of the PR and between 292032e and 6cd012b.

📒 Files selected for processing (2)
  • pkg/subscraping/sources/crtsh/crtsh.go
  • pkg/subscraping/sources/github/github.go

Walkthrough

This PR closes the crtsh SQL cursor after querying subdomains and adds an early return after GitHub rate-limit retries so discarded responses are not processed further.

Changes

Subscraping source fixes

Layer / File(s) Summary
crtsh cursor cleanup
pkg/subscraping/sources/crtsh/crtsh.go
getSubdomainsFromSQL now defers rows.Close() after a successful SQL query.
GitHub retry exit
pkg/subscraping/sources/github/github.go
Source.enumerate now returns immediately after recursively retrying a 403 response with no remaining rate limit.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 I hop through cursors, neat and tight,
and close them up before the night.
When GitHub shouts, “Try once more!”,
I hop away and read no more.
Fresh subdomains sparkle in sight.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately reflects the main change: fixing source leaks.
Linked Issues check ✅ Passed The changes match issue #1800 by closing crtsh rows and returning after the GitHub rate-limit retry.
Out of Scope Changes check ✅ Passed No unrelated or extra scope changes are indicated beyond the two leak fixes in the linked issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch source-leaks

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@dogancanbakir
dogancanbakir merged commit c312787 into dev Jul 1, 2026
9 checks passed
@dogancanbakir
dogancanbakir deleted the source-leaks branch July 1, 2026 08:53
social4hyq pushed a commit to social4hyq/homebrew-core that referenced this pull request Sep 20, 2026
subfinder 2.15.0

Created-by: HarmonybrewBot
Commit-by: HarmonybrewBot
Merged-by: HarmonybrewBot
Description: Created by `brew bump`

---

Created with `brew bump-formula-pr`.<details>
  <summary>release notes</summary>
  <pre>## What's Changed

### 🎉 New Features
* Added shodanct passive source by @dogancanbakir in projectdiscovery/subfinder#1796
* Added Option `-vR`, `-virustotal-res` for VirusTotal source by @Bundy01 in projectdiscovery/subfinder#1719
* Added machine-readable source listing with `-ls -oJ` by @Gerijacki in projectdiscovery/subfinder#1812

### 🐞 Bug Fixes
* Fixed source leaks by @Mzack9999 in projectdiscovery/subfinder#1801
* Fixed drain source channels on cancel so source goroutines exit instead of leaking on a blocked send by @Mzack9999 in projectdiscovery/subfinder#1799
* Fixed crtsh's query by dropping unused certificate metadata from SQL query by @ChrisJr404 in projectdiscovery/subfinder#1787
* Fixed VirusTotal source by capping pagination and providing clearer 429 message by @ChrisJr404 in projectdiscovery/subfinder#1788
* Fixed Anubis source by switching subdomain API to anubisdb.com by @jatinder14 in projectdiscovery/subfinder#1815

### Other Changes
* Fixed lint issues by @dogancanbakir in projectdiscovery/subfinder#1820
* Refactored loadFromFile to use bufio.Scanner by @nandaanomi in projectdiscovery/subfinder#1791


## New Contributors
* @ChrisJr404 made their first contribution in projectdiscovery/subfinder#1787
* @Bundy01 made their first contribution in projectdiscovery/subfinder#1719
* @nandaanomi made their first contribution in projectdiscovery/subfinder#1791
* @jatinder14 made their first contribution in projectdiscovery/subfinder#1815
* @Gerijacki made their first contribution in projectdiscovery/subfinder#1812

**Full Changelog**: https://github.com/projectdiscovery/subfinder/compare/v2.14.0...v2.15.0</pre>
  <p>View the full release notes at <a href="https://github.com/projectdiscovery/subfinder/releases/tag/v2.15.0">https://github.com/projectdiscovery/subfinder/releases/tag/v2.15.0</a>.</p>
</details>
<hr>

See merge request: Harmonybrew/homebrew-core!16007
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.

crtsh leaks db cursor and github source falls through after rate-limit retry

2 participants