Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add detection for CVE-2024-47575 #137

Merged
merged 2 commits into from
Nov 21, 2024
Merged

Add detection for CVE-2024-47575 #137

merged 2 commits into from
Nov 21, 2024

Conversation

ybadaoui-ostorlab
Copy link
Contributor

@ybadaoui-ostorlab ybadaoui-ostorlab commented Nov 20, 2024

This PR introduces detection logic for CVE-2024-47575, a critical vulnerability in FortiManager caused by missing authentication for critical functions.

Detection Mechanism

The check function performs the following steps to determine if the target is vulnerable:

  1. Initial Requests:
    • Sends get ip and get auth requests to establish the session.
  2. Vulnerable Case:
    • If the response to the get file_exchange request includes a non-empty remoteid value, the target is identified as vulnerable, and a finding is reported.
  3. Secure Case:
    • If the remoteid is missing or empty, no vulnerabilities are reported.

2024-11-20_14-03

@ybadaoui-ostorlab ybadaoui-ostorlab marked this pull request as draft November 20, 2024 14:31
Copy link
Contributor

@nmasdoufi-ol nmasdoufi-ol left a comment

Choose a reason for hiding this comment

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

Good job pulling this detection together 👍

@ybadaoui-ostorlab ybadaoui-ostorlab marked this pull request as ready for review November 20, 2024 14:42
Copy link

codecov bot commented Nov 20, 2024

Codecov Report

Attention: Patch coverage is 76.41509% with 25 lines in your changes missing coverage. Please review.

Project coverage is 96.13%. Comparing base (8ca3c93) to head (557d119).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
agent/exploits/cve_2024_47575.py 62.90% 23 Missing ⚠️
tests/exploits/cve_2024_47575_test.py 95.45% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #137      +/-   ##
==========================================
- Coverage   96.46%   96.13%   -0.34%     
==========================================
  Files         176      178       +2     
  Lines        6287     6393     +106     
==========================================
+ Hits         6065     6146      +81     
- Misses        222      247      +25     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.


🚨 Try these New Features:

agent/exploits/cve_2024_47575.py Outdated Show resolved Hide resolved
agent/exploits/cve_2024_47575.py Outdated Show resolved Hide resolved
agent/exploits/cve_2024_47575.py Outdated Show resolved Hide resolved
agent/exploits/cve_2024_47575.py Outdated Show resolved Hide resolved
agent/exploits/cve_2024_47575.py Outdated Show resolved Hide resolved
Comment on lines +155 to +161
if remote_id != "":
vulnerability = self._create_vulnerability(target)
vulnerabilities.append(vulnerability)
except (UnicodeDecodeError, IndexError, ValueError):
return vulnerabilities

return vulnerabilities
Copy link
Member

Choose a reason for hiding this comment

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

why are we using list if we only append one vulnerability? if we need it to be a list maybe we can do `return [vulnerability]? and can we return directly without appending? since it seem that we only return once

Comment on lines +96 to +97
except TimeoutError:
return b""
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't we add an error logging here?

Copy link
Member

Choose a reason for hiding this comment

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

+1

@3asm 3asm merged commit 5294866 into main Nov 21, 2024
3 of 5 checks passed
@3asm 3asm deleted the feature/cve_2024_47575 branch November 21, 2024 00:35
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.

9 participants