The only thing you could get from a mattress is scabies, which is very uncommon now, or bed bugs, which isn't an STI but is more common. You could possibly also get norovirus, staph, e. coli, and maybe MRSA.
https://www.dreams.co.uk/sleep-matters-club/health-risks-of-an-old-mattress
https://www.menshealth.com/health/a19523027/how-your-mattress-makes-you-sick/
Before going, find out how clean the mattress are.