KeePassRPC technical detail discusses things from the KeePassRPC perspective. The key section relevant to your question is the transport protocol. In our case, we use websockets and it turns out that there is no protection against any remote website from connecting to a websocket running on localhost.
There has always been the possibility of another system being able to remotely connect to the network port, firewalls permitting, so we designed the protocol such that any access attempts would be authenticated and transparent to the user. It is in two implementation details of this design that the vulnerabilities have been found and fixed.
At the time of development, this was the only possible way to connect KeePass to a browser extension. An alternative technology has been developed in the past few years (as mentioned in the security release announcement); we’re considering switching to that one day if times permits or someone contributes the code for the new approach, as per the GitHub issue https://github.com/kee-org/browser-addon/issues/23