Following the war, Cobb returned to film, television and theater before being accused of being a Communist in 1951 testimony before the House Un-American Activities Committee by Larry Parks, himself a former Communist Party member. Cobb was called to testify before HUAC but refused to do so for two years until, with his career threatened by the blacklist, he relented in 1953 and gave testimony in which he named 20 people as former members of the Communist Party USA. Following the hearing he resumed his career and worked with Elia Kazan and Budd Schulberg, two other HUAC "friendly witnesses", on the 1954 film On the Waterfront, which is widely seen as an allegory and apologia for testifying. His 1968 performance as King Lear achieved the longest run (72 performances) for the play in Broadway history. One of his final film roles was that of police detective Lt. Kinderman in the 1973 horror film The Exorcist.
Cobb died of a heart attack in February 1976 in Woodland Hills, California, and was buried in Mount Sinai Memorial Park Cemetery in Los Angeles. He was survived by his second wife, Mary Hirsch, and daughter, also an accomplished actress, Julie Cobb.