You don't have to worry about cancer.
You should check with the doctor; maybe you don't need surgery. Sounds like as a baby, you had undescended testicles, which is pretty normal/common in babies.
The problem with them going up inside you, and not staying in your scrotum, is that your sperm production is compromised. The reason testicles hang below is to keep them slightly cooler. If they are the same temperature as the rest of your body, you make bad sperm, not enough, etc.
At 17, you probably don't want to get anyone pregnant, but you do want to get the problem sorted soon so that you don't have to worry about infertility or other testicle problems later.