A loophole is an ambiguity or inadequacy in a system, such as a law or security, which can be used to circumvent or otherwise avoid the purpose, implied or explicitly stated, of the system.
Originally, the word meant an arrowslit, a narrow vertical window in a wall through which an archer (or, later, gunman) could shoot. Loopholes were commonly used in U.S. forts built during the 1800s. Located in the sally port, a loophole was considered a last ditch defense, where guards could close off the inner and outer doors trapping enemy soldiers and using small arms fire through the slits.
Loopholes are distinct from lacunae, although the two terms are often used interchangeably. In a loophole, a law addressing a certain issue exists, but can be legally circumvented due to a technical defect in the law, such as a situation where the details are under-specified. A lacuna, on the other hand, is a situation in which no law exists in the first place to address that particular issue.
See also: Collective intelligence and White hat (computer security)
Loopholes are searched for and used strategically in a variety of circumstances, including elections, politics, taxes, the criminal justice system, or in breaches of security.