Skip to content

[Bug] Fix AttributeError and Incorrect Exception in AbuseSubmitter connector. Closes #3557#3562

Merged
mlodic merged 2 commits intointelowlproject:developfrom
chauhan-varun:fix/abuse-submitter-attribute-error
Mar 27, 2026
Merged

[Bug] Fix AttributeError and Incorrect Exception in AbuseSubmitter connector. Closes #3557#3562
mlodic merged 2 commits intointelowlproject:developfrom
chauhan-varun:fix/abuse-submitter-attribute-error

Conversation

@chauhan-varun
Copy link
Copy Markdown

@chauhan-varun chauhan-varun commented Mar 27, 2026

Description

The AbuseSubmitter connector was crashing with an AttributeError when attempting to access the name of an analyzable through a nested job hierarchy (self._job.parent_job.parent_job.analyzable.name) without verifying if the parent levels existed. This typically happened when the connector was triggered outside of the intended Takedown_Request playbook flow.

Additionally, the connector was incorrectly raising AnalyzerRunException (an analyzer-specific error) instead of ConnectorRunException, which caused it to bypass the standard error handling for connectors.

Key Changes:

  • Added a private validation method _validate_job_hierarchy to safely verify the existence of parent_job and its grandparent before property access.
  • Updated the subject and body properties to use this validation.
  • Switched the exception type to ConnectorRunException and updated the corresponding imports.
  • (Verified the fix with a local test suite and manual execution in the Django shell).

fixes #3557

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).

Checklist

  • I have read and understood the rules about how to Contribute to this project
  • The pull request is for the branch develop
  • A new plugin (analyzer, connector, visualizer, playbook, pivot or ingestor) was added or changed, in which case:
    • I strictly followed the documentation "How to create a Plugin"
    • Usage file was updated. A link to the PR to the docs repo has been added as a comment here (N/A for logic fix).
    • Advanced-Usage was updated (N/A).
    • I have dumped the configuration from Django Admin using the dumpplugin command and added it in the project as a data migration. (N/A - existing plugin logic fix).
    • If a File analyzer was added and it supports a mimetype which is not already supported, you added a sample of that type inside the archive test_files.zip and you added the default tests for that mimetype in test_classes.py (N/A).
    • If you created a new analyzer and it is free (does not require any API key), please add it in the FREE_TO_USE_ANALYZERS playbook by following this guide (N/A).
    • Check if it could make sense to add that analyzer/connector to other freely available playbooks (N/A).
    • I have provided the resulting raw JSON of a finished analysis and a screenshot of the results (N/A - bug fix).
    • If the plugin interacts with an external service, I have created an attribute called precisely url that contains this information. This is required for Health Checks (HEAD HTTP requests) (N/A).
    • If a new analyzer has beed added, I have created a unittest for it in the appropriate dir. I have also mocked all the external calls, so that no real calls are being made while testing (N/A).
    • I have added that raw JSON sample to the get_mocker_response() method of the unittest class. This serves us to provide a valid sample for testing (N/A).
    • I have created the corresponding DataModel for the new analyzer following the documentation (N/A).
  • I have inserted the copyright banner at the start of the file: # This file is a part of IntelOwl https://github.com/intelowlproject/IntelOwl # See the file 'LICENSE' for copying permission.
  • Please avoid adding new libraries as requirements whenever it is possible. Use new libraries only if strictly needed to solve the issue you are working for. In case of doubt, ask a maintainer permission to use a specific library.
  • If external libraries/packages with restrictive licenses were added, they were added in the Legal Notice section.
  • Linters (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 (see tests folder). All the tests (new and old ones) gave 0 errors.
  • If the GUI has been modified (N/A):
    • I have a provided a screenshot of the result in the PR.
    • I have created new frontend tests for the new component or updated existing ones.
  • After you had submitted the PR, if DeepSource, Django Doctors or other third-party linters have triggered any alerts during the CI checks, I have solved those alerts.

@chauhan-varun
Copy link
Copy Markdown
Author

chauhan-varun commented Mar 27, 2026

Hey @mlodic I've fixed the AttributeError in AbuseSubmitter and updated the exception type. I also added a new test file to verify the fix! PTAL

image

@mlodic mlodic merged commit f5d6806 into intelowlproject:develop Mar 27, 2026
9 checks passed
@chauhan-varun chauhan-varun deleted the fix/abuse-submitter-attribute-error branch March 27, 2026 14:02
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