Now, who paid for the security deposit? and did you get some sort of deposit from the person who sublet the place?
Best way to navigate this, is to ask owner to draw another lease with the name of the new tenants, and give deposits back to previous renters.
Best of luck,
When the initial renter is signing the lease, it makes them responsible for any damages that may occur. This will most likely be the outcome, regardless of any secondary contracts between the original renter and the sub-letter. At best, there would have to be two separate processes to correct the situation.
For this reason, it would be a better solution to create a new lease between the landlord and the new renter, with a possible contract limiting the length of the stay.
Hopefully you have an agreement that makes the sublease tenant responsible to you, so you can recoup any losses.