Preserve Module-defined Timeout Values (Fixes #1515)#1516
Preserve Module-defined Timeout Values (Fixes #1515)#1516Aarush289 wants to merge 17 commits intoOWASP:masterfrom
Conversation
create pr
Document all modules ( fix OWASP#1269 ) (OWASP#1270)
Signed-off-by: Aarush <cs24b064@smail.iitm.ac.in>
Removed entry for FortiWeb authentication bypass vulnerability. Signed-off-by: Aarush <cs24b064@smail.iitm.ac.in>
Signed-off-by: Aarush <cs24b064@smail.iitm.ac.in>
Signed-off-by: Aarush <cs24b064@smail.iitm.ac.in>
Merge new changes
Merge new modules
Pull the changes
merge the changes
Add the new changes
MERGE NEW changes
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Summary by CodeRabbit
Walkthrough
Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
nettacker/core/template.py (1)
21-21: Use the configured default timeout instead of a magic number.Line 21 hardcodes
3.0; usingConfig.settings.timeoutkeeps this logic aligned with config if the default changes later.Proposed fix
- elif key == "timeout" and abs(module_inputs[key] - 3.0) > 1e-9: + elif key == "timeout" and abs(module_inputs[key] - Config.settings.timeout) > 1e-9: module_content[key] = module_inputs[key]🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@nettacker/core/template.py` at line 21, Replace the hardcoded magic number 3.0 in the timeout comparison inside the template logic (the branch that checks key == "timeout" and inspects module_inputs[key]) with the configured default timeout value (Config.settings.timeout); i.e., use abs(module_inputs[key] - Config.settings.timeout) > 1e-9 so the check follows the configured default and not a literal 3.0.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@nettacker/core/template.py`:
- Around line 18-19: The current conditional in the template merge drops
explicit falsy overrides (0, False, "") because it tests truthiness; update the
condition in the merge logic that writes into module_content (referencing
module_inputs and module_content in template.py) to allow explicit falsy values
to override YAML: only skip the override when the key is "timeout" or the key is
absent/None. Concretely, replace the truthy check with a presence/None check so
keys present in module_inputs (even if 0/False/empty string) are copied into
module_content, while still excluding "timeout" as before.
---
Nitpick comments:
In `@nettacker/core/template.py`:
- Line 21: Replace the hardcoded magic number 3.0 in the timeout comparison
inside the template logic (the branch that checks key == "timeout" and inspects
module_inputs[key]) with the configured default timeout value
(Config.settings.timeout); i.e., use abs(module_inputs[key] -
Config.settings.timeout) > 1e-9 so the check follows the configured default and
not a literal 3.0.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: cdb8e946-e782-467e-a1fd-6e816da7e451
📒 Files selected for processing (1)
nettacker/core/template.py
Proposed change
This PR fixes an issue where the timeout field defined in modules was always being overwritten by the default CLI timeout value (e.g., 3.0), even when the user did not explicitly provide a timeout.

Behavior After Fix
Module-defined timeout is preserved when no CLI timeout is provided.
CLI-provided timeout overrides module value only when explicitly set (i.e., not equal to default 3.0).
Fixes #1515
Tested by changing timeout value of one of the modules :-
Type of change
Checklist
make pre-commitand confirm it didn't generate any warnings/changesmake testand I confirm all tests passed locallydocs/folder