This is a mashup of “hanging by a thread” (something is in a dangerous state and likely to fail) and I think “have (someone) on the string” (to keep someone awaiting a decision). Threads and strings are similar so it seems logical that something would be hanging by a string, but...