The Media Directories module for Drupal organizes media into directories and provides a media browser. A vulnerability exists where the media browser API does not properly verify access to text formats, allowing users with certain permissions to save text in unauthorized formats. This can lead to cross-site scripting (XSS) when the text is displayed. Exploitation requires the user to have both the Access Media Directories browser permission and media creation or editing rights, and the media type must include a formatted text field. A fix is available in version 3.0.1.