Most likely it is an aphthous ulcer that forms on the mucous membranes. Anyone can get an aphthous ulcer; 20% of the population have one or more, at least occasionally. So no need to worry as long as it does not increase in size or does not heal in 2 weeks by itself.
Next Steps
1. Antibacterial mouthwashes to reduce secondary infection.
2. Avoidance of foods that trigger or exacerbate the ulcers.
3. Dietary supplements of vitamins or minerals, if the diet is deficient.
4. Reduction in stress