4 ms·
From a security perspective, I don't think it's possible to do with the standard OS APIs. When an application makes data available in the clipboard, it's a fre
by CyberShadow 5y ago
From a security perspective, I don't think it's possible to do with the standard OS APIs.
When an application makes data available in the clipboard, it's a free-for-all for every other application. The clipboard manager would have to race other applications to make a copy of the data, and then empty the OS clipboard.
APIs also may not allow making decisions based on which application requested the clipboard. It's possible to do in X11, but not Windows.
This goal could be achievable by intercepting the OS clipboard API. On X11, this can be done by MITM-ing the connection to the X server - https://github.com/CyberShadow/hax11 https://github.com/CyberShadow/hax11 does this, and already has one clipboard-related security feature (disabling the selection mechanism). On Windows, the best bet is probably global DLL injection and API hooks, but applications can "opt out" by running as a different user or requesting a higher integrity level.