Yes, you do need to be careful when performing squats with a Smith machine–and yes, you can get injured. Performing a squat with a regular barbell or free weights allows your movement pattern to follow a natural arc. The Smith machine does not allow for this natural movement. It is more fixed and unnatural, and loads the spine in a way that can set you up for injury (to your back and knees).
It is not a piece of equipment that I personally prefer for squats. That being said, if it is all you have and you are going to use it, please make sure you know how to position your feet properly.