The vulnerability is a bypass of a previous prototype pollution fix (GHSA-q8qp-cvcw-x6jj) in Axios. The original fix protected the top-level configuration object by creating it with Object.create(null). However, this protection did not extend to nested objects, such as the proxy configuration object.
The root cause lies in two functions. First, lib/utils.js#merge is used to combine configuration objects. When a user provides a proxy object in their configuration, merge creates a new, nested object for the proxy settings as a plain {}. This new object inherits from Object.prototype, making it susceptible to prototype pollution.
Second, the lib/adapters/http.js#setProxy function reads properties like username, password, and auth from this merged proxy object without using hasOwnProperty checks. If an attacker has previously polluted Object.prototype with these properties, setProxy will incorrectly read the attacker-controlled values from the prototype chain. It then uses these values to construct a Proxy-Authorization header, which is injected into all subsequent proxied requests.
The patch addresses this by introducing strict hasOwnProperty checks in both merge and setProxy. In setProxy, a new readProxyField helper is added to ensure that only own properties of the proxy object are accessed. In merge, property reads are now guarded by hasOwnProperty to prevent polluted prototype values from being copied into the final merged configuration. This combination of fixes ensures that nested configuration objects are no longer vulnerable to prototype pollution.