We have noticed cracks appearing in a leg of our bathroom vanity unit (run right through the leg). May have been caused by water damage. I had presumed it was MDF but not sure if I can confirm this. I have tried to clamp (with a ratchet clamp) the leg to see if the gaps close, but they didn't. Any advice on how to repair and or stop the cracks growing? Ideally without having to remove the unit as it is plumbed in.
It does seem to be some sort of particle board type of construction in the post. Based on this bit of your picture:
It appears that the leg has swollen starting about where the arrows indicate.
Particle board is made by compressing particles of wood and resin under very high pressure and at temperature (to cure the resin). There really isn't a way for you to squeeze this back together with any sort of household clamps. You might have a chance if you could build some sort of steel frame and put a couple of 20 ton (or so) hydraulic jacks in there and press them toward each other, but that's... a bit over the top. Even if you could squeeze it back straight, you wouldn't be able to get any resin or glue in there that would hold it in that position. Plus, there's already moisture in the leg, so other areas would start to fail sooner rather than later anyway.
Your best bet to repair is probably to cut off the swollen area of the leg and replace it. You would want to work a piece of lumber - you might consider pressure treated for additional moisture resistance for spills, though it's not really necessary - down to the size of the leg, then join it.
The easiest way to attach it would probably be with a bridle joint*. A half lap** joint would work very well, too and may be even easier to make. Both links refer to making them with power tools, but a simple, sharp hand saw will be more than sufficient so long as you measure accurately.
Once you've made the appropriate cuts in the remainder of the post and the replacement leg, apply glue, slide the new leg in and clamp until dry (I'd give it overnight, just to be sure). Then repaint.
Unfortunately, you'll probably find it exceedingly difficult to do this with the vanity in place, especially since you'll be cutting toward the wall and will risk cutting into your baseboard. You're probably at the point of just needing to pull the vanity out of the bathroom so you can take it to the garage to work on it. Turning off the water, unscrewing the supply lines and unscrewing the drain lines shouldn't be all that difficult. There are a plethora of Q&As here that will explain just about any possible situation you may run across.
With the vanity removed, you'll also be able to give the rest of the legs a thorough inspection for potential damage. You'd probably also want to ensure that you apply a good coat of paint to the bottom of the legs to help protect them from future water damage.
*This is the first link I found to explain what it is, no recommendation of the site in particular. Of note, there seems to be a security certificate issue with the site, you may want to do your own search.
**Again, the first result for a search for "half lap" - no particular recommendation of the site linked.