Tagging systems allow users to interactively annotate a pool of shared resources using descriptive tags. As tagging systems are gaining in popularity, they become more susceptible to tag spam: misleading tags that are generated in order to increase the visibility of some resources or simply to confuse users. We introduce a framework for modeling tagging systems and user tagging behavior. We also describe a method for ranking documents matching a tag based on taggers’ reliability. Using our framework, we study the behavior of existing approaches under malicious attacks and the impact of a moderator and our ranking method. Categories and Subject Descriptors H.3.3 [Information Search and Retrieval]: [Retrieval models, Search process]; H.3.5 [Online Information Services]: [Data sharing, Web-based services] Keywords Tag spam, tagging systems, social systems