Explore chapters and articles related to this topic
Design and Development (A4): SDL Activities and Best Practices
Published in James F. Ransome, Anmol, Mark S. Merkow, Practical Core Software Security, 2023
James F. Ransome, Anmol, Mark S. Merkow
Using a question-driven approach can help with the review activity. A list of standard questions can help you focus on common security vulnerabilities that are not unique to your soft-ware’s architecture. This approach can be used in conjunction with techniques such as control flow and data flow analysis to optimize the ability to trace those paths through the code that are most likely to reveal security issues. Questions should address at least the most common coding vulnerabilities. Ask these questions while you are using control flow and dataflow analysis. Keep in mind that finding some vulnerabilities may require contextual knowledge of control and data flow, whereas others will be context-free and can be found using simple pattern matching. Some of the following techniques may be combined when doing a manual security review of the code: Control flow analysis. Control flow analysis is the mechanism used to step through logical conditions in the code. The process is as follows: Examine a function and determine each branch condition. These may include loops, switch statements, “if” statements, and “try/catch” blocks.Understand the conditions under which each block will execute.Move to the next function and repeat.Data flow analysis. Data flow analysis is the mechanism used to trace data from the points of input to the points of output. Because there can be many data flows in an application, use your code review objectives and the flagged areas from Step 2 to focus your work. The process is as follows: For each input location, determine how much you trust the source of input. When in doubt, you should give it no trust.Trace the flow of data to each possible output. Note any attempts at data validation.Move to the next input and continue.30
A GCC-based checker for compliance with MISRA-C's single-translation-unit rules
Published in Connection Science, 2023
Chih-Yuan Chen, Yung-An Fang, Guan-Ren Wang, Peng-Sheng Chen
Several static analysis tools can detect whether a program is compliant with the MISRA-C rules. These tools are either commercial or open source. Examples of commercial software include Parasoft (Parasoft, n.d.), PC-Lint (Vector Informatik, n.d.), Helix QAC (Perforce Software, n.d.), PVS-Studio (PVS-Studio, n.d.), IAR C-STAT (IAR Systems, n.d.), Coverity (Synopsys, n.d.a), CodeSonar (GrammaTech, n.d.), and Polyspace (MathWorks, n.d.). The most well-known and widely used open-source tool is Cppcheck (Cppcheck, n.d.), which can detect software bugs, undefined behavior, dangerous coding constructs, and coding style. In Cppcheck, a program is preprocessed to an internal token list. Each token can access the related syntax tree and symbol information via proper APIs. The checker analyzes the token list according to pre-defined rules. Cppcheck also contains a value-flow analysis and simple control-flow analysis to improve the correctness of the analysis. Users can easily customise checking rules to meet their needs. All these tools are third-party software independent of the compiler.
Security analysis of smart contract based rating and review systems: the perilous state of blockchain-based recommendation practices
Published in Connection Science, 2022
Jitendra Singh Yadav, Narendra Singh Yadav, Akhilesh Kumar Sharma
It supports different Solidity versions to compile smart contracts and a lightweight static analysis tool that includes control flow analysis. In addition, it detects various syntactical errors and warnings in the code during compilation. The warnings cover different security vulnerabilities.