If a city's violation shows up as a lien against the property, the owner of that property would be held responsible for it. yes, if you are a buyer who decides to buy it with the lien on it, you will be responsible to cure it.
Before you buy it, find out if the lack of permit is something that can be legalized. Sometimes it is just a matter of submitting the blue prints and going through the permitting process. Of course you will probably have to pay any penalties that remain unpaid. Ask if you could negotiate to reduce.
Then decide if it is still worth the trouble and expense.