Race Conditions in Distributed Enforcement at the Example of Online Social Networks In today's society, online social networks (OSNs) play an increasingly important role in sharing common interests between individuals. It is favourable to give the users of OSNs more control over their sensitive data so that the data owners can limit not only the access to the data, but also the future usage of data by other users. These security policies can sensibly base on inter-personal relationships between contacts. Enforcing such security policies can be achieved by dynamically monitoring the social network and intervening upon detecting unacceptable actions. In distributed social networks (DSNs), determining whether or not an action is acceptable usually requires communication between different servers. During the decision-making, changes in the state of servers, such as changing the type of relationships between contacts, can occur that lead to incorrect decisions. Detecting and preventing race conditions are challenging research topics. This thesis studies the soundness of runtime enforcement of owner-obeying security policies in DSNs. We formally define such a security policy, present an enforcement mechanism at runtime for it, and discuss some approaches for achieving a sound enforcement, in context of time of check to time of use (TOCTTOU) race conditions. We also present an implementation of our enforcement on the distributed social network Diaspora*.