It leaks oil because of o-ring/rubber seals inside it.
Long time back mechanics used to change these o rings/seals and master cylinder start working fine again for years. But now due to awareness no one takes the risk for changing the seals.
I will suggest to buy new. Because most of the master brake cylinders which you will find from junk market are not actually kabuli and most of them are locally repaired (changing seals).
So there are only two solutions.
Take your vehicle to workshop and ask them to open the master cylinder and separate it seals. Take those seals to Badami bagh (because you can find the originals at low price from that market), bring them back to workshop, replace them in the master cylinder and see if it works.
In 90% of the cases the seal/o-ring of the piston inside this master cylinder leaks which needs to be change carefully. Need to prime the cylinder with brake oil before & after replacing that o ring.
If this works, then you have the cheapest solution.
Otherwise as plan B, plz buy the only brand new master cylinder and replace it.