While you can legally possess Xanax with a valid prescription, being found in illegal possession can result in criminal charges. Depending on how much was found in your possession, you could spend up to five years in prison.