Does this mean you've just started squatting? Or have you been squatting some other way? Bodyweight? DBs held at your sides?
Well, you might try DBs, but you won't be able to use a wide stance. Still, at this point, let's try anything that might work, right?
So it's side-to-side swaying, not falling forward or backward? Is it always in the same direction? Try stretching your legs, hip flexors, adductors and abductors one leg at a time. Is one more tight than the other? It sounds like maybe you aren't bending symmetrically as you go down. Have someone stand directly behind you and tell you if your glutes are centered during the descent. You might be coming down way off-center due to some imbalance in strength or flexibility in your legs. That could cause the problem.
So...in no particular order:
1. Try squatting narrow stance with DBs
2. Try stretching to discover an imbalance (and just for the health of it)
3. Get an observer to check your symmetry
No prob. Hope it helps. Let us know.