It depends on your local law. In many states if you disclose the lack of a permit and in the purchase agreement have the buyer indemnify for any later problems due to a lack of a permit you may be covered. Will a buyer want to indemnify you? That’s another issue.
I’m selling my apartment and will disclose that kitchen, bathroom have been remodelled without permit. Buyer will be aware. If the buyer decides to condo convert and the city inspects the unit, of course finds out that these remodells were done without permit, will this be the buyers problem only as I disclosed everything, or are there any repercussions for me as the seller. thanks, Susan