caught with (one's) hand in the cookie jar
To have been caught in the act or attempt of some wrongdoing, especially one involving bribery or the illicit exploitation of one's position of power or authority. The senator was long accused of insider trading, and he was finally caught with his hand in the cookie jar when his conversation with a Wall Street executive was leaked to the media.