SecureDev

One of the vulnerabilities that exist within C is code injection attacks. This attack is a security vulnerability in which the attacker can injects malicious code onto the targeted system with the aim of executing arbitrary code on the target system. This type of attack can be executed using SQL injection, cross-site scripting and buffer overflow attacks. The attacker offends use this vulnerability to remotely execute code, control the targeted system, acquire sensitive data or to further their attack onto other systems (must preferable along a network). The vulnerability exist main because some programming are unaware the they are supposed to dynamically allocate memory in C (Turner, S.,2014). Another vulnerability is buffer overflow that usually occurs be C has no way of identifying when an array or allocation memory is overran. Signs of a buffer overflow are: crash or slow running which signals a leaking of memory is occurring. Furthermore, programmers are restricted with arrays in C and have to go to great lengths to correct these limits. An attacker that is familiar with these limitations can utilize a web field to launch an attack. These attackers usually intentionally exceed the fixed-length static array and can manipulate these string operations to write outside the bounds of the statically allocated character array, which might be 80 characters.
In order to prevent code injection attacks, one of the procedures is to validate all users input along with sanitizing any data that is received from an untrustworthy source. In addition, your C software and compiler should keep up to date with the latest security patches and should be written with security as a main focus. Use function that are design to prevent buffer overflow like strncpy() instead of using strcpy(). Furthermore, you can use static analysis tool such as Coverity, Klocwork and fortify to check if there is a buffer overflow in your code. You could even use stack canaries which are value located on a stack that is validate that the stack has not been overwritten before returning a function.

Java use design with security in mine so most of the vulnerabilities in C are not present in java, however language-based attack exists in java too, this is where an attacker takes advantage of the vulnerabilities in the java programming language itself, rather than the vulnerabilities in your java code. Reflection attacks is one of such vulnerabilities which allows the java code to be inspected or modified at runtime. This type of attack can be used to gain access to protected or private field, method or constructors, which they can then use to gain unauthorized access or manipulate information. Another vulnerability is serialization attacks, serialization is when data is converted to byte streams that can then be transferred over a network. The attackers can use serialization attack to inject malicious code into the objects that will execute when deserialized. Java Native Interface attack, is another type of vulnerability that exist in java. Java Native Interference is used to execute code from another programming language such as C or C++. Attacker usually use Java Native Interface to bypass Java built-in security features and run an arbitrary code with elevated privileges. Classloader attacks, in java classloaders are in charge of loading classes. These type of attack happen when the classloading process in manipulated to load malicious code into the Java Virtual Machine, which they can then execute with elevated privileges. Finally, log injection attack is when the attacker input malicious code or character within the log file with the aim of modifying or exploiting the log analysis process.

In order to limit language-based attacks in Java, it is essential to keep the Java runtime environment up-to-date with the most recent security patches and to adopt secure coding practices. Programmers should also avoid using risky features like reflection, serialization, and Java Native Interface unless absolutely necessity within the project your doing, and utilize security mechanisms such as sandboxes and security managers to mitigate untrusted code privileges. Further use input validation fields in the java program to validate and sanitize you code to prevent malicious code or characters from being injected into log file. Using secure logging libraries like Log4j 2 and limit access to the log files through restricting use to authorized persons only and ensure that log files are not readily available to be access.

Python programming has few vulnerabilities, but because python was built on top of C Programming Language some of C’s vulnerabilities exist within python namely buffer overflow. Buffer overflow usually occurs because C has no way of identifying when an array or allocation memory is overrun. Signs of a buffer overflow are: crash or slow running which signals a leaking of memory is occurring. Another type of vulnerability that exist whin python is access control vulnerabilities this occurs when there is insufficient or incorrect implementation of access control methods. Insecure Object Permissions is ones of python access control vulnerabilities however python's object model allows the programmer to set permissions on objects. If the programmer fails to set the appropriate permissions, a user may be able to change or access the object in a way that was not intended. For example, if a user is able to modify an object that is meant to be read-only, it could result in data corruption. Secondly, Improper Authentication, while authentication is the process of verifying the identity of a user. If authentication is not implemented correctly, it could result in unauthorized access to resources. For example, if a Python web application fails to properly authenticate users, an attacker could gain access to sensitive information or functionality.