The thermosphere contains traces of carbon dioxide and water, which may have been deposited from external sources such as meteorites and dust.