The vulnerability is a classic prototype pollution flaw in the web3-core-method package, specifically within the attachToObject function. This function is intended to add methods to web3 module objects. The vulnerability allows an attacker to inject properties into Object.prototype by using a crafted payload. This occurs because the function does not properly sanitize or validate the property names being assigned, allowing malicious keys like __proto__ to be used to traverse up the prototype chain and modify the global Object.prototype.
My analysis of the commits between the vulnerable version 1.10.3 and the patched version 1.10.4 did not reveal the exact code change that mitigates this vulnerability. The commits mainly consist of dependency updates and version bumps. This suggests that the vulnerability might have been fixed by updating a dependency that web3-core-method relies on for object manipulation, or the fix is in a commit that was not immediately obvious from the comparison.
Despite the lack of a clear patch, the CVE description and the nature of prototype pollution vulnerabilities strongly point to the attachToObject function as the entry point for the exploit. Any runtime profile during exploitation would show this function in the stack trace as it processes the malicious input.