作茧自缚

zuò jiǎn zì fù

to spin a cocoon around oneself (idiom); enmeshed in a trap of one's own devising

hoist by his own petard

zuò

to do; to engage in

jiǎn

variant of 繭|茧[jian3]

(bound form) self; oneself

to bind