January 2022 Summaries
10 posts from StackHawk
Filter
Month:
Year:
Post Summaries
Back to Blog
The latest version of the StackHawk scanner, also known as HawkScan, introduces several new features aimed at simplifying the integration of application security testing into development workflows. Key enhancements include a new command-line interface (CLI), configuration linting, and custom authentication support, which address common challenges faced by engineers. The scanner is available as both a Docker image and a CLI, with each offering unique benefits depending on the deployment scenario. The CLI provides more granular control and speed, making it ideal for local development environments, while Docker is better suited for CI/CD pipelines. Configuration validation is improved through real-time feedback and YAML linting, helping prevent errors before scans are initiated. The new version also supports OpenAPI specification linting and offers enhanced authentication options, allowing for custom scripting in JavaScript and Kotlin to meet diverse authentication needs. These updates aim to ensure efficient and reliable application security testing as an integral part of the software delivery process.
Jan 28, 2022
1,439 words in the original blog post.
Implementing effective authentication and session management in React applications is crucial to avoid vulnerabilities that can lead to broken authentication, allowing attackers to exploit user accounts. Developers often overlook real-world scenarios where users might leave their accounts logged in on public devices or networks, creating security risks. To counteract this, developers can implement client-side techniques such as mapping session IDs to device IDs and locations, using libraries like FingerprintJS and the Geolocation API. Additionally, implementing auto sign-out features for idle users using the react-idle-timer package can prevent unauthorized access. Proper session management includes generating and storing session IDs securely, avoiding insecure methods such as storing them in URL query strings, and instead using local storage accessed through custom React hooks. These practices, along with encouraging strong password usage, can significantly reduce the risk of authentication breaches. This guide, provided by Siddhant Varma, a full stack JavaScript developer, offers practical solutions for improving authentication security in React apps.
Jan 27, 2022
1,865 words in the original blog post.
XML External Entities (XXE) injection is a significant security vulnerability that can be exploited by malicious users to access sensitive data and files on servers, especially in applications that parse XML data. This method of attack is listed among OWASP's top 10 web application security risks and poses a threat to platforms like Laravel if not appropriately mitigated. An XXE attack can allow an attacker to retrieve sensitive files, perform server-side request forgery (SSRF), and execute blind XXE attacks, where the success is determined by indirect feedback. Preventive measures include disabling XML parser features such as document type definitions (DTD) and external entities, validating user-generated XML data, and turning off error messages that may inadvertently expose sensitive information. Regular updates and adhering to security best practices are crucial for protecting applications from XXE vulnerabilities. This educational piece, written by Pius Aboyi—an experienced mobile and web developer—provides insights and practical steps to secure Laravel applications against XXE through examples and preventive strategies.
Jan 26, 2022
1,291 words in the original blog post.
The exploration of command injection vulnerabilities in JavaScript and how to mitigate them is crucial for maintaining the security of applications built on modern technologies like TypeScript and Node.js. Despite the excitement of working with cutting-edge technologies, developers face challenges such as limited documentation, rough edges, and security vulnerabilities, including command injection attacks where attackers inject malicious code into servers. These attacks exploit functions like 'exec' and 'eval', allowing unauthorized access to systems. To combat this, developers are advised to avoid using these functions, employ input sanitization mechanisms, and utilize security analysis tools like StackHawk to regularly scan applications for vulnerabilities. By adhering to best practices and leveraging robust security solutions, developers can ensure their applications are resilient against evolving web threats. This emphasis on security is essential for both developers seeking to solve problems and managers aiming to enhance product value, as highlighted by Juan Reyes, an engineer with a diverse background and a passion for self-development and leadership.
Jan 25, 2022
1,319 words in the original blog post.
The article delves into SQL injection within the context of TypeScript-based applications, particularly using NodeJS, highlighting the risks and impact of such attacks on organizational infrastructure. It explains SQL injection as an attack exploiting poor database integration and user input validation, allowing attackers to manipulate or access sensitive data through the input fields. Illustrative examples are provided to demonstrate how basic SQL knowledge can be used to exploit vulnerabilities, emphasizing the simplicity and commonality of such attacks. The article outlines preventive measures, such as implementing input validation at both the user interface and application levels, using query placeholders, and employing third-party libraries to enhance security. It underscores the importance of these measures in protecting against SQL injection, suggesting that the investment in establishing robust security practices pays off in the long term. The piece is authored by Juan Reyes, who draws from his diverse experiences to write about technical and personal development topics.
Jan 24, 2022
1,595 words in the original blog post.
When dealing with a front-end app accessing a .NET API, developers might encounter errors related to the Cross-Origin Resource Sharing (CORS) policy, which can block access due to security restrictions known as the same-origin policy. This policy is essential for web safety, preventing scripts from interacting with unauthorized resources. However, there are legitimate cases, such as a client accessing a back-end API, where bypassing this restriction is necessary. The article provides a detailed guide on how to enable CORS in a .NET API by setting up a simple API and allowing requests from a specified origin using the HTTP method GET, with any header, through modifications in the Program.cs file. By understanding and implementing CORS, developers can safely relax these restrictions, facilitating smooth communication between different application components, while maintaining security.
Jan 20, 2022
1,445 words in the original blog post.
TypeScript has become an integral part of modern web development, enhancing front-end frameworks like React and Angular, yet developers must remain vigilant about security issues such as DOM-based cross-site scripting (XSS) vulnerabilities. XSS attacks occur when malicious JavaScript is injected into a website, exploiting voids left by inadequate code practices. Although TypeScript compiles to JavaScript and offers robust features, it does not inherently protect against XSS attacks, which can be perpetrated by manipulating the Document Object Model (DOM) without proper safeguards. For instance, using the append method without sanitizing inputs can allow attackers to inject harmful scripts. To mitigate these risks, developers should prefer methods like textContent over append, leverage state management in frameworks, and sanitize HTML content using tools like Angular's DomSanitizer, especially when dealing with dynamic content or user inputs. By understanding and addressing these vulnerabilities, developers can protect their applications from potential threats. The insights provided by Siddhant Varma, a full-stack JavaScript developer, emphasize the importance of secure coding practices and HTML sanitization in preventing XSS attacks.
Jan 18, 2022
1,623 words in the original blog post.
Cross-Origin Resource Sharing (CORS) is a crucial aspect of web development that regulates whether a browser can access resources from a server with a different origin, often leading to errors when not properly configured. In modern web applications, which typically follow a client-server architecture, the same-origin policy imposed by browsers prevents resource sharing across different domains for security reasons. However, many applications require interaction with servers or third-party APIs of different origins, necessitating the use of CORS to lift these restrictions. The server is responsible for enabling CORS by setting appropriate headers, such as "Access-Control-Allow-Origin," to allow specific clients access. The article provides a practical guide to enabling CORS in a Node.js and TypeScript application, demonstrating the process with a sample API and a React client, and highlights the importance of server-side configuration in resolving CORS issues.
Jan 14, 2022
1,788 words in the original blog post.
StackHawk has launched a Command-Line Interface (CLI) tool, offering an alternative to its existing Docker-based version, to integrate security scanning into developers' workflows more seamlessly. This new CLI, which eliminates the need for a Docker container, is designed for use on local computers and provides a familiar tool for developers while maintaining support for the Docker version that is ideal for CI/CD pipelines. To get started with the CLI, users need a StackHawk account, an app configured on the platform, Java version 11 or higher, and a method to install the CLI, such as homebrew or a zip file. The CLI includes commands for initializing the scanner, validating configuration files, and running scans, with extensive documentation and resources like video demos available to assist users. Despite the new introduction, StackHawk ensures continued support for the Docker version, catering to different user preferences and operational needs.
Jan 13, 2022
857 words in the original blog post.
The StackHawk blog post, authored by Carlos Schults, provides an insightful introduction to .NET command injection, a type of code injection attack where malicious actors exploit vulnerabilities to execute arbitrary commands on a server's operating system. The post explains the fundamentals of command injections, the potential dangers they pose, and demonstrates a practical example using a .NET MVC app, highlighting the risks associated with improperly handled user inputs. Schults emphasizes the importance of not blindly trusting external data and suggests strategies to prevent such attacks, such as avoiding direct OS command execution, validating input with regular expressions or allowlists, and utilizing .NET's static analysis security rules like CA3006. The guide aims to educate .NET developers on recognizing and defending against command injections, underscoring the necessity of diligence in software security practices.
Jan 13, 2022
1,290 words in the original blog post.