Methodology of testing for LSCP:
1. Code Review:
This is the process of checking the source code to detect issues that might have been overlooked in the initial development phase. It includes checking the code against secure coding standards.
2. Статичний аналіз:
This involves analyzing the code without executing it. Static analysis tools can automatically detect common vulnerabilities such as buffer overflows, SQL injection, and cross-site scripting.
3. Динамічний аналіз:
This involves analyzing the code while it’s running. It can help detect runtime errors such as memory leaks and null pointer dereferencing.
4. Penetration Testing:
This involves simulating an attack on the system to discover vulnerabilities. It can help identify weaknesses that might be exploited in a real-world attack.
5. Threat Modeling:
This involves identifying potential threats and designing countermeasures to prevent or mitigate the effects of those threats.
6. Use of Security Frameworks and Libraries:
Using established security frameworks and libraries can help avoid common security mistakes.
7. Training and Awareness:
Developers should be trained in secure coding practices and be aware of the importance of security.
Tools that detect vulnerabilities:
There are several tools available that can help detect vulnerabilities due to lack of secure coding practices. These tools are often categorized into two types: Static Application Security Testing (SAST) tools and Dynamic Application Security Testing (DAST) tools.
SAST Tools:
Analyze source code or compiled versions of code to help find security flaws.
Can be integrated into your IDE to detect issues during software development.
Identify well-known vulnerabilities such as buffer overflows and SQL injection flaws.
Highlight the problematic code, by filename, location, line number, and even the affected code snippet.
However, they may have difficulty automating searches for many types of security vulnerabilities, including authentication problems, access control issues, insecure use of cryptography, and they may produce high numbers of false positives.
Klocwork: Works with C, C#, C++, and Java codebases and is designed to scale with any size project.
Checkmarx: Provides comprehensive solutions for SAST and is widely used in the industry.
Veracode: Offers cloud-based application security services including SAST.
CyberRes Fortify: Provides elements of both SAST and DAST testing.
SpectralOps: Unique in the landscape since it scans the entire codebase.
DAST Tools:
Scan web applications, normally from the outside, to look for security vulnerabilities such as Cross-site scripting, SQL Injection, Command Injection, Path Traversal, and insecure server configuration.
A large number of both commercial and open-source tools of this type are available, and all of these tools have their strengths and weaknesses.
Intruder: An automated, dynamic cloud-based vulnerability management solution.
SOOS: A dynamic application security testing tool that partners with a software composition.
Invicti: Formerly Netsparker, it’s particularly desirable for businesses that need to show compliance to HIPAA or PCI DSS.
Acunetix: A dashboard of automated DAST that is suitable for use by the IT technicians of medium-sized to large enterprises.
Veracode Dynamic Analysis: An easy-to-use test automation solution that integrates well into the DevOps cycle.
Popular exploits:
Lack of secure coding practices can lead to a variety of vulnerabilities that can be exploited. Here are some of the most common types of exploits that can result from insecure coding practices:
Injection Attacks:
These occur when untrusted data is sent to an interpreter as part of a command or query. The attacker’s hostile data can trick the interpreter into executing unintended commands or accessing unauthorized data.
Порушений контроль доступу:
Restrictions on what authenticated users are allowed to do are often not properly enforced. Attackers can exploit these flaws to access unauthorized functionality and/or data, such as accessing other users’ accounts, viewing sensitive files, modifying other users’ data, changing access rights, etc.
Sensitive Data Exposure:
Many web applications and APIs do not properly protect sensitive data, such as financial, healthcare, and PII. Attackers may steal or modify such weakly protected data to conduct credit card fraud, identity theft, or other crimes.
XML External Entities (XXE):
Many older or poorly configured XML processors evaluate external entity references within XML documents. External entities can be used to disclose internal files using the file URI handler, internal file shares, internal port scanning, remote code execution, and denial of service attacks.
Security Misconfigurations:
Security misconfiguration is the most commonly seen issue. This is commonly a result of insecure default configurations, incomplete or ad hoc configurations, open cloud storage, misconfigured HTTP headers, and verbose error messages containing sensitive information.
Міжсайтовий скриптінг (XSS):
XSS flaws occur whenever an application includes untrusted data in a new web page without proper validation or escaping, or updates an existing web page with user-supplied data using a browser API that can create HTML or JavaScript.
Insecure Deserialization:
Insecure deserialization often leads to remote code execution. Even if deserialization flaws do not result in remote code execution, they can be used to perform attacks, including replay attacks, injection attacks, and privilege escalation attacks.
Using Components with Known Vulnerabilities:
Components, such as libraries, frameworks, and other software modules, run with the same privileges as the application. If a vulnerable component is exploited, such an attack can facilitate serious data loss or server takeover.
Insufficient Logging & Monitoring:
Insufficient logging and monitoring, coupled with missing or ineffective integration with incident response, allows attackers to further attack systems, maintain persistence, pivot to more systems to tamper with, extract, or destroy data.