Skip to content

Fix unauthenticated feeds memory exhaustion DoS. Closes #844#993

Merged
regulartim merged 2 commits intointelowlproject:developfrom
R1sh0bh-1:fix/feeds-memory-exhaustion-dos
Mar 11, 2026
Merged

Fix unauthenticated feeds memory exhaustion DoS. Closes #844#993
regulartim merged 2 commits intointelowlproject:developfrom
R1sh0bh-1:fix/feeds-memory-exhaustion-dos

Conversation

@R1sh0bh-1
Copy link
Copy Markdown
Contributor

Description

This PR fixes a critical Memory Exhaustion Denial of Service (DoS) vulnerability in the unauthenticated /api/feeds/ endpoint, where an unbounded feed_size parameter could be exploited to crash the application's worker processes due to out-of-memory (OOM) errors.

As discussed by the maintainers, the basic /api/feeds/ endpoints have been secured by explicitly filtering request.query_params to only accept explicitly documented parameters (include_mass_scanners, include_tor_exit_nodes, feed_type, attack_type, ioc_type, and prioritize). All undocumented parameters, including feed_size, are now strictly ignored, enforcing the default size of 5000 and rendering the DoS attack vector completely obsolete.

Advanced/authenticated endpoints are left unchanged to support large, valid research queries as intended.

Related issues

Closes #844

Type of change

  • Bug fix (non-breaking change which fixes an issue).
  • New feature (non-breaking change which adds functionality).
  • Breaking change (fix or feature that would cause existing functionality to not work as expected).
  • Chore (refactoring, dependency updates, CI/CD changes, code cleanup, docs-only changes).

Checklist

Please complete this checklist carefully. It helps guide your contribution and lets maintainers verify that all requirements are met.

Formalities

  • I have read and understood the rules about how to Contribute to this project.
  • I chose an appropriate title for the pull request in the form: <feature name>. Closes #999
  • My branch is based on develop.
  • The pull request is for the branch develop.
  • I have reviewed and verified any LLM-generated code included in this PR.

Docs and tests

  • I documented my code changes with docstrings and/or comments.
  • I have checked if my changes affect user-facing behavior that is described in the docs. If so, I also created a pull request in the docs repository.
  • Linter (Ruff) gave 0 errors. If you have correctly installed pre-commit, it does these checks and adjustments on your behalf.
  • I have added tests for the feature/bug I solved.
  • All the tests gave 0 errors.

@R1sh0bh-1
Copy link
Copy Markdown
Contributor Author

@regulartim please have a look and let me know if any changes are required.

Copy link
Copy Markdown
Collaborator

@regulartim regulartim left a comment

Choose a reason for hiding this comment

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

Hey @R1sh0bh-1 ! Two things:

  • the tests don't actually test if the undocumented parameters are ignored, right?
  • you wrote the allow list twice - I think you can safely use the more permissive allow list for both endpoints

@R1sh0bh-1
Copy link
Copy Markdown
Contributor Author

Thanks for the review @regulartim! Both points addressed — I've improved the test assertions to pass feed_size=1 and verify the response still returns more than 1 result, directly proving the parameter is filtered out rather than just checking for a 200 OK. I've also extracted the documented parameters into a single module-level constant ALLOWED_UNAUTHENTICATED_QUERY_PARAMS and reused it across both feeds()and feeds_pagination(), using the more permissive union of both lists as you suggested. Let me know if there's anything else to address!

@R1sh0bh-1 R1sh0bh-1 requested a review from regulartim March 11, 2026 07:53
Copy link
Copy Markdown
Collaborator

@regulartim regulartim left a comment

Choose a reason for hiding this comment

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

Looks good, thank you! :)

@regulartim regulartim merged commit 59c5ba4 into intelowlproject:develop Mar 11, 2026
4 checks passed
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.

2 participants