The vulnerability, described as 'Gryph Agents Payload Filter Fails to Strip Tool Payload for Sensitive Content', is caused by improper handling of sensitive data in the logging mechanism. The analysis of the patch between version v0.6.0 and v0.7.0 of safedep/gryph revealed the root cause.
The core of the vulnerability is in the agent.ApplyLoggingLevel function. In the vulnerable versions, this function would not strip sensitive information from event payloads if the logging level was set to standard (the default) or full. This meant that if an agent performed an operation on a file identified as sensitive (e.g., containing secrets), the content of that file could be logged to the local SQLite database. This violates the expectation that sensitive content is never logged.
The patch addresses this by modifying agent.ApplyLoggingLevel to first check if an event is marked as sensitive. If it is, it now unconditionally calls stripPayloadContent to remove any sensitive data from the payload before any further processing, regardless of the configured logging level. This ensures that sensitive data is never persisted.
The cli.runHook function is identified as a key runtime indicator because it is the function that orchestrates the parsing of agent events and calls agent.ApplyLoggingLevel. Therefore, during the exploitation of this vulnerability, cli.runHook would be on the call stack leading to the vulnerable logic.