Sounds like the kind of thing that'd last until you tried to sell the house, and a prospective buyer's home inspector caught it. Then you'd end up paying for proper work to be done, one way or another.
The seller has a legal duty to disclose known defects and work done without proper permits or not according to code. And they don't disclose, and the defect is subsequently discovered buy the buyer, the seller can be sued.