CVE-2023-40723: Agent2Shellv2
A world-readable log file on FortiSIEM Linux Agent contains a reusable authorization header that can be decoded to reveal a plaintext password. An attacker with access to the log can use the header to call an API that returns sensitive configuration data, including the PostgreSQL database password, and then access the database to escalate privileges.
medium.com
Published on medium.com
An endpoint within FortiSIEM accepts authorization headers that can be reused or replayed. If an attacker gains access to the agent’s authorization header through any means, they can craft a request that returns sensitive configuration data — notably, plaintext database passwords.
The full write-up lives on its author's site
It belongs to its author, so we link to it rather than copy it. The other two tabs are our own rewrites, checked against it.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
How it worked
Root cause
Likely the application logged sensitive authentication headers in a world-readable file and used a static, replayable token for API authentication.
Impact
An attacker could gain Full Admin access to the FortiSIEM GUI, disable device monitoring, modify scheduled reports, decrypt sensitive passwords, and gain full control over the FortiSIEM Supervisor instance.
What the attacker needed
Access to the agent log file; network access to FortiSIEM API; network access to PostgreSQL port
The fix
The report recommends restricting log file permissions, avoiding logging sensitive information, using time-sensitive tokens, encrypting database backups, and applying least privilege; it does not state that a fix was applied.
How it was found
- Gain access to the FortiSIEM Linux Agent log file.
- Extract and decode the authorization header from the log.
- Send crafted API requests using the stolen header to retrieve system configuration values, including the PostgreSQL database password.
- Use the database password to connect to the PostgreSQL service on the FortiSIEM Supervisor instance.
- Query the ph_sys_conf table to retrieve the System_Key and encrypted device credentials.
- Use the System_Key to decrypt the master key and access organization data.
Explained by bugbounty.wiki with AI from the original and checked against quotes from it; it can still be wrong. Read the original before relying on a detail.
Not written yet. The AI write-up for this write-up has not been written yet. The Original tab links to the source.
A log file on the FortiSIEM agent was readable by any user on the system and contained a secret code (an authorization header) that could be decoded to get a password. An attacker who could read that log file could use the secret code to ask the FortiSIEM server for configuration details, including the database password, and then log into the database to take control.
What is Info disclosure?
Data the application should keep private (personal data, internal details, other users' records) reaches someone it should not.