Application security testing company GrammaTech announced on Wednesday that it has released an open source tool designed to detect API usage errors.
The tool, named SWAP Detector, was developed as part of a research project sponsored by the U.S. Department of Homeland Security (DHS) and GrammaTech says it can be highly useful for DevOps application security testing.
A lot of software applications rely on third-party APIs and it’s important for developers to identify API usage errors, which can introduce security and reliability issues.
SWAP Detector analyzes function calls in code in an effort to detect potential swapped argument errors. If such an error is detected, the user is warned and the warning is also assigned a score.
The tool can be integrated with static analysis products such as Clang-Tidy, Clang Static Analyzer, and PyLint. SWAP Detector initially focuses on applications written in C and C++, but GrammaTech says it’s applicable to code written in other programming languages as well, particularly for interpreted — rather than compiled — languages.
“SWAP Detector uses multiple error-detection techniques, layered together to increase accuracy. For example, it compares argument names used in call sites with the parameter names used in corresponding declarations,” GrammaTech explained.
“In addition, it uses ‘Big Code’ techniques, applying statistical information about usages of ‘known good’ API-usage patterns collected from a large corpus of code, and flagging usages that are statistically anomalous as potential errors. To improve the precision of the reported warnings, SWAP Detector applies false-positive reduction strategies to the output of both techniques,” it added.
The SWAP Detector source code is available on GitHub.
Related: ‘Have I Been Pwned’ Code Base Going Open Source
Related: Nearly 1,000 Vulnerabilities Found in Popular Open Source Projects in 2019
Related: IBM Releases Open Source Toolkits for Processing Data While Encrypted
Related: Google Releases Open Source Tool for Finding File Access Vulnerabilities

Eduard Kovacs (@EduardKovacs) is a contributing editor at SecurityWeek. He worked as a high school IT teacher for two years before starting a career in journalism as Softpedia’s security news reporter. Eduard holds a bachelor’s degree in industrial informatics and a master’s degree in computer techniques applied in electrical engineering.
More from Eduard Kovacs
- OpenSSL 1.1.1 Nears End of Life: Security Updates Only Until September 2023
- Google Links More iOS, Android Zero-Day Exploits to Spyware Vendors
- ChatGPT Data Breach Confirmed as Security Firm Warns of Vulnerable Component Exploitation
- Thousands Access Fake DDoS-for-Hire Websites Set Up by UK Police
- Intel Boasts Attack Surface Reduction With New 13th Gen Core vPro Platform
- Dole Says Employee Information Compromised in Ransomware Attack
- High-Severity Vulnerabilities Found in WellinTech Industrial Data Historian
- CISA Expands Cybersecurity Committee, Updates Baseline Security Goals
Latest News
- Malware Hunters Spot Supply Chain Attack Hitting 3CX Desktop App
- LeapXpert Banks $22M Funding to Secure Corporate Messaging With Consumer Apps
- Blockchain Security Firm True I/O Raises $9 Million
- Spera Banks $10 Million to Tackle Identity and Access Sprawl
- OpenAI Patches Account Takeover Vulnerabilities in ChatGPT
- OpenSSL 1.1.1 Nears End of Life: Security Updates Only Until September 2023
- New Wi-Fi Attack Allows Traffic Interception, Security Bypass
- Casino Giant Crown Resorts Investigating Ransomware Group’s Data Theft Claims
