The vulnerability, GHSA-68v4-hmwv-f43h, involves the improper handling of sensitive headers during cross-origin HTTP redirects in the openclaw package. When a media download was initiated from a URL that redirected to a different origin, headers such as Authorization and Cookie were forwarded to the new destination, risking credential leakage.
The root cause of this vulnerability is located in the downloadToFile function in src/media/store.ts. This function, which handles the download and redirect logic, used a faulty utility function, retainSafeHeadersForCrossOriginRedirectHeaders, to sanitize headers. This utility, located in src/infra/net/fetch-guard.ts, failed to correctly strip sensitive headers before the redirect request was made.
The patch rectifies this issue by refactoring the header-stripping logic into a new file (src/infra/net/redirect-headers.ts) with a correct implementation and updating the downloadToFile function to use this new utility. During exploitation, a runtime profile would show saveMediaSource calling downloadToFile, which in the vulnerable version would then call the flawed retainSafeHeadersForCrossOriginRedirectHeaders function, leading to the credential leak.