<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: SmartScanner</title>
    <description>The latest articles on Forem by SmartScanner (@smartscanner).</description>
    <link>https://forem.com/smartscanner</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F580076%2F96668ef9-cfed-40b9-b624-b6442cdee5f5.png</url>
      <title>Forem: SmartScanner</title>
      <link>https://forem.com/smartscanner</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/smartscanner"/>
    <language>en</language>
    <item>
      <title>Does Your App Reveal Its Server Header? You Might Be Helping Attackers</title>
      <dc:creator>SmartScanner</dc:creator>
      <pubDate>Mon, 23 Feb 2026 13:00:38 +0000</pubDate>
      <link>https://forem.com/smartscanner/does-your-app-reveal-its-server-header-you-might-be-helping-attackers-2b8i</link>
      <guid>https://forem.com/smartscanner/does-your-app-reveal-its-server-header-you-might-be-helping-attackers-2b8i</guid>
      <description>&lt;p&gt;Most developers focus on fixing SQL injection, XSS, and authentication bugs.&lt;/p&gt;

&lt;p&gt;But many applications expose something far simpler and surprisingly useful to attackers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;Server: Apache/2.4.50 (Debian)
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This single line can dramatically reduce the effort required to compromise your system.&lt;/p&gt;

&lt;p&gt;Let’s break down why this matters, how attackers use it, and how you can fix it in minutes.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Is the Server Header?
&lt;/h2&gt;

&lt;p&gt;Every HTTP response may include a &lt;code&gt;Server&lt;/code&gt; header that identifies the web server software handling the request.&lt;/p&gt;

&lt;p&gt;Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-I&lt;/span&gt; https://example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Response:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="k"&gt;HTTP&lt;/span&gt;&lt;span class="o"&gt;/&lt;/span&gt;&lt;span class="m"&gt;1.1&lt;/span&gt; &lt;span class="m"&gt;200&lt;/span&gt; &lt;span class="ne"&gt;OK&lt;/span&gt;
&lt;span class="na"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Mon, 17 Mar 2025 10:25:28 GMT&lt;/span&gt;
&lt;span class="na"&gt;Server&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;Apache/2.4.50 (Debian)&lt;/span&gt;
&lt;span class="na"&gt;Content-Type&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s"&gt;text/html&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This reveals:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Server software: Apache&lt;/li&gt;
&lt;li&gt;Version: 2.4.50&lt;/li&gt;
&lt;li&gt;OS: Debian&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;From a functionality perspective, this header is unnecessary. Your application works perfectly fine without exposing this information.&lt;/p&gt;

&lt;p&gt;From a security perspective, it’s valuable intelligence.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why This Is Dangerous
&lt;/h2&gt;

&lt;p&gt;The header itself is not a vulnerability. But it makes exploitation faster, easier, and more reliable.&lt;/p&gt;

&lt;p&gt;Think of it like leaving a note on your front door:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;"This house uses Lock Model X, version 1.2 — known to be pickable."&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;An attacker no longer needs to guess. &lt;br&gt;
They know exactly what to target.&lt;/p&gt;
&lt;h2&gt;
  
  
  How Attackers Actually Use It
&lt;/h2&gt;

&lt;p&gt;Here’s a typical attack workflow:&lt;/p&gt;
&lt;h3&gt;
  
  
  Step 1: Scan target
&lt;/h3&gt;

&lt;p&gt;Attacker sends a simple request:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-I&lt;/span&gt; https://target.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Sees:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;Server: Apache/2.4.50
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2: Search for known vulnerabilities
&lt;/h3&gt;

&lt;p&gt;They search vulnerability databases and find:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;CVE-2021-41773&lt;/strong&gt; — Path traversal and remote code execution in Apache 2.4.50.&lt;/p&gt;

&lt;p&gt;Public exploits exist.&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Run the exploit
&lt;/h3&gt;

&lt;p&gt;No guesswork. No brute force. Just targeted exploitation. What could have taken hours now takes minutes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why This Matters More Than You Think
&lt;/h2&gt;

&lt;p&gt;Attackers rarely hack manually anymore. They automate reconnaissance at scale.&lt;br&gt;
Bots scan millions of servers and classify targets based on headers.&lt;/p&gt;

&lt;p&gt;Example automation logic:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;IF Server == Apache/2.4.50
THEN run exploit CVE-2021-41773
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your server becomes part of an automated attack pipeline.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Check Your Own Application
&lt;/h2&gt;

&lt;p&gt;You can test your app in seconds.&lt;/p&gt;

&lt;h3&gt;
  
  
  Option 1: curl
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-I&lt;/span&gt; https://yourdomain.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Option 2: Browser DevTools
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Open DevTools → Network tab&lt;/li&gt;
&lt;li&gt;Reload page&lt;/li&gt;
&lt;li&gt;Click request → Headers&lt;/li&gt;
&lt;li&gt;Look for &lt;code&gt;Server&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How to Automatically Detect This Across Your Apps
&lt;/h2&gt;

&lt;p&gt;Manually checking one app is easy. Checking dozens is not.&lt;/p&gt;

&lt;p&gt;Security scanners can automatically detect server version disclosure and other risks.&lt;/p&gt;

&lt;p&gt;For example, you can scan your application using &lt;strong&gt;SmartScanner&lt;/strong&gt;:&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://www.thesmartscanner.com/" rel="noopener noreferrer"&gt;TheSmartScanner.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;It detects:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Server version disclosure&lt;/li&gt;
&lt;li&gt;Security misconfigurations&lt;/li&gt;
&lt;li&gt;OWASP Top 10 vulnerabilities&lt;/li&gt;
&lt;li&gt;Information leakage issues&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It’s especially useful if you manage multiple apps or environments.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Fix It (Quick Wins)
&lt;/h2&gt;

&lt;p&gt;Goal: Remove or obfuscate the Server header.&lt;/p&gt;

&lt;h3&gt;
  
  
  Nginx
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight nginx"&gt;&lt;code&gt;&lt;span class="k"&gt;server_tokens&lt;/span&gt; &lt;span class="no"&gt;off&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Apache
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight apache"&gt;&lt;code&gt;&lt;span class="nc"&gt;ServerTokens&lt;/span&gt; Prod
&lt;span class="nc"&gt;ServerSignature&lt;/span&gt; &lt;span class="ss"&gt;Off&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  ASP.NET (web.config)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;system.webServer&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;security&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;requestFiltering&lt;/span&gt; &lt;span class="na"&gt;removeServerHeader=&lt;/span&gt;&lt;span class="s"&gt;"true"&lt;/span&gt; &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/security&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/system.webServer&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Node.js (Express)
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;disable&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;x-powered-by&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You may also need a reverse proxy (Nginx, Cloudflare, etc.) to fully remove headers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Important: This Is NOT a Substitute for Updating
&lt;/h2&gt;

&lt;p&gt;Removing the header does not fix vulnerabilities. It only removes reconnaissance data.&lt;/p&gt;

&lt;p&gt;Think of it as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Locking your doors (good)&lt;/li&gt;
&lt;li&gt;Still patch your system (essential)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Always:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Keep servers updated&lt;/li&gt;
&lt;li&gt;Apply security patches&lt;/li&gt;
&lt;li&gt;Use supported versions&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Bonus: Other Headers You Should Review
&lt;/h2&gt;

&lt;p&gt;These can also leak information:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;X-Powered-By: ASP.NET
X-AspNet-Version: 4.0.30319
X-AspNetMvc-Version: 5.2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Remove them unless absolutely required.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick Security Checklist
&lt;/h2&gt;

&lt;p&gt;Do this today:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;[ ] Remove Server header&lt;/li&gt;
&lt;li&gt;[ ] Remove X-Powered-By header&lt;/li&gt;
&lt;li&gt;[ ] Update server software&lt;/li&gt;
&lt;li&gt;[ ] Use supported versions only&lt;/li&gt;
&lt;li&gt;[ ] Put a reverse proxy in front of your app&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Most breaches don’t start with sophisticated zero-day exploits. They start with information disclosure. Something as small as a response header can be the first domino.&lt;/p&gt;

&lt;p&gt;Fix it now. It takes minutes. But it removes valuable intelligence from attackers.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>security</category>
      <category>express</category>
      <category>devops</category>
    </item>
    <item>
      <title>Introducing SmartScanner: Your Go-To Security Buddy for Node.js</title>
      <dc:creator>SmartScanner</dc:creator>
      <pubDate>Wed, 26 Feb 2025 07:21:09 +0000</pubDate>
      <link>https://forem.com/smartscanner/introducing-smartscanner-your-go-to-security-buddy-for-nodejs-366l</link>
      <guid>https://forem.com/smartscanner/introducing-smartscanner-your-go-to-security-buddy-for-nodejs-366l</guid>
      <description>&lt;p&gt;Hey Node.js developers! We all know that building awesome apps with Node.js—from APIs to full-stack solutions—is a blast. But with great power comes great responsibility: security. Whether you're working on an Express API, a NestJS backend, or a NextJS project, keeping your application safe is a must. That's where &lt;strong&gt;SmartScanner&lt;/strong&gt; comes in.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.thesmartscanner.com/" rel="noopener noreferrer"&gt;SmartScanner&lt;/a&gt; is a super-easy security scanning tool designed to help you find and fix vulnerabilities in your Node.js apps. It’s like having an extra pair of eyes checking your code while you focus on building cool features.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Node.js Security Matters
&lt;/h2&gt;

&lt;p&gt;Node.js is everywhere, handling everything from sensitive user data to complex business logic. But with its massive ecosystem and third-party packages, security issues can sneak in. Some common threats include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Injection Attacks:&lt;/strong&gt; SQL, NoSQL, or command injections can lead to big problems.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cross-Site Scripting (XSS):&lt;/strong&gt; Malicious scripts can damage user trust.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Misconfigurations:&lt;/strong&gt; Even a small misstep can expose sensitive info.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Vulnerable Dependencies:&lt;/strong&gt; Some npm packages might have known security issues.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Staying on top of these risks is key to keeping your users safe and your reputation solid.&lt;/p&gt;

&lt;h2&gt;
  
  
  Meet SmartScanner: Your Security Sidekick
&lt;/h2&gt;

&lt;p&gt;SmartScanner automates the security check of your Node.js app so you can focus on coding. Here’s why it’s a must-have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Easy to Use:&lt;/strong&gt; Just enter your app’s URL, hit “Scan,” and let SmartScanner do its magic.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Detailed Reports:&lt;/strong&gt; Get clear insights on what’s wrong and how to fix it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Framework-Friendly:&lt;/strong&gt; Works great with Express, NestJS, and NextJS.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Real-World Testing:&lt;/strong&gt; Simulate different HTTP methods and authentication to see how your app holds up.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automation:&lt;/strong&gt; Use SmartScanner's command line interface to automate your testing process.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;SmartScanner is all about helping you build secure applications without the headache.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Get Started with SmartScanner
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Install SmartScanner:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
&lt;a href="https://www.thesmartscanner.com/download" rel="noopener noreferrer"&gt;Download and Install SmartScanner&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Deploy Your App:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Fire up your Node.js server. Whether it’s an API, a NestJS module, or a NextJS project, make sure it’s accessible (for example, &lt;code&gt;http://localhost:3000&lt;/code&gt;).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Run SmartScanner:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Open SmartScanner, paste your app’s URL, and click “Scan.”&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Tip:&lt;/strong&gt; Use SmartScanner’s HTTP testing tab to simulate POST, PUT, or DELETE requests with custom headers and payloads.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Review the Report:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Check out the detailed results. SmartScanner will list vulnerabilities—including issues like XSS—that need fixing. Make your changes, then scan again to confirm everything’s locked down.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Real-World Examples: How SmartScanner Enhances Your Code
&lt;/h2&gt;

&lt;h3&gt;
  
  
  1. Locking Down Your Express API
&lt;/h3&gt;

&lt;p&gt;APIs are the backbone of many apps, but they can be vulnerable if not secured properly. Here’s a friendly example with Express:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;express&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;express&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;helmet&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;helmet&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;express&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="c1"&gt;// Add Helmet to set secure HTTP headers&lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;helmet&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;

&lt;span class="c1"&gt;// Vulnerable endpoint: echoes user input without sanitization (potential XSS)&lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;/vulnerable&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;userInput&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;query&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;input&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;send&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`User input: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;userInput&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;3000&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Server running on http://localhost:3000&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this Express example, the &lt;code&gt;/vulnerable&lt;/code&gt; route echoes a query parameter without sanitization, creating a simple &lt;strong&gt;&lt;a href="https://www.thesmartscanner.com/vulnerability-list/cross-site-scripting" rel="noopener noreferrer"&gt;Cross-Site Scripting (XSS)&lt;/a&gt;&lt;/strong&gt; vulnerability. SmartScanner can detect this issue along with other security gaps like missing headers or weak configurations.  &lt;/p&gt;

&lt;p&gt;If you're diving deep into Express security, don’t miss our guides:  &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://www.thesmartscanner.com/blog/how-to-secure-your-nodejs-express-javascript-application-part-1" rel="noopener noreferrer"&gt;How to Secure your NodeJs Express Javascript Application - part 1&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.thesmartscanner.com/blog/how-to-secure-your-nodejs-express-javascript-application-part-2" rel="noopener noreferrer"&gt;How to Secure your NodeJs Express Javascript Application - part 2&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Boosting Security in Your NestJS App
&lt;/h3&gt;

&lt;p&gt;NestJS gives you a structured way to build scalable apps, but you still need to watch out for security pitfalls. Consider this simple NestJS controller:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="k"&gt;import&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;Controller&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;Get&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;@nestjs/common&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;Controller&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;users&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="kd"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;UsersController&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="nd"&gt;Get&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
  &lt;span class="nf"&gt;findAll&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="nx"&gt;string&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;This action returns all users&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once deployed, running SmartScanner on your NestJS endpoint helps catch misconfigurations or overlooked vulnerabilities in your controllers and middleware.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Securing Your NextJS Project
&lt;/h3&gt;

&lt;p&gt;NextJS is awesome for both server-side rendering and static sites, but it also mixes server and client code. Here’s a simple NextJS API route:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// pages/api/hello.js&lt;/span&gt;
&lt;span class="k"&gt;export&lt;/span&gt; &lt;span class="k"&gt;default&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;handler&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;200&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Hello, secure world!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;SmartScanner will scan this endpoint to ensure that your full-stack project is secure from both server-side and client-side vulnerabilities.&lt;/p&gt;

&lt;h2&gt;
  
  
  Best Practices for Node.js Security
&lt;/h2&gt;

&lt;p&gt;While SmartScanner is a great tool, here are some extra tips to help you keep your app secure:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Keep Dependencies Updated:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Use tools like &lt;code&gt;npm audit&lt;/code&gt; to spot and fix vulnerable packages.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Validate User Inputs:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Always sanitize and validate data to block injection attacks.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Secure Sensitive Data:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Use environment variables for API keys and credentials—never hardcode them.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Use Security Middleware:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Libraries like Helmet can help set secure HTTP headers automatically.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Practice Least Privilege:&lt;/strong&gt;&lt;br&gt;&lt;br&gt;
Limit access rights to only what’s necessary for each part of your app.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Wrap-Up
&lt;/h2&gt;

&lt;p&gt;Security isn’t just a checklist—it’s an ongoing part of building awesome Node.js applications. By incorporating &lt;strong&gt;&lt;a href="https://www.thesmartscanner.com/download" rel="noopener noreferrer"&gt;SmartScanner&lt;/a&gt;&lt;/strong&gt; into both your code testing and your development workflow, you're not only catching vulnerabilities early but also fostering a security-first culture on your team.&lt;/p&gt;

&lt;p&gt;So, fire up your server, integrate SmartScanner into your CI/CD pipeline, and keep your Node.js apps secure and running smoothly. Happy coding and stay secure!&lt;/p&gt;

</description>
      <category>node</category>
      <category>security</category>
      <category>devops</category>
      <category>development</category>
    </item>
    <item>
      <title>Should I Hide My Admin Login Page? Yes, You Should!</title>
      <dc:creator>SmartScanner</dc:creator>
      <pubDate>Mon, 16 Sep 2024 09:00:00 +0000</pubDate>
      <link>https://forem.com/smartscanner/should-i-hide-my-admin-login-page-yes-you-should-2dnj</link>
      <guid>https://forem.com/smartscanner/should-i-hide-my-admin-login-page-yes-you-should-2dnj</guid>
      <description>&lt;p&gt;As a web application owner, you might be wondering whether hiding your login page is necessary. The short answer is: &lt;strong&gt;Yes, you should hide your admin login page!&lt;/strong&gt; However, this only applies to &lt;strong&gt;admin interface login pages&lt;/strong&gt; and &lt;strong&gt;not&lt;/strong&gt; user login pages.&lt;/p&gt;

&lt;p&gt;In this article, we’ll explore why protecting your admin login page is crucial, the risks of leaving it exposed, and effective measures to safeguard it from potential attacks.&lt;/p&gt;

&lt;h2&gt;
  
  
  What is an Admin Interface?
&lt;/h2&gt;

&lt;p&gt;Most web applications provide an interface for administrators to manage critical aspects of the site, such as content updates, user management, and system configurations. These interfaces enable essential tasks, such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Changing website content or adding new pages.&lt;/li&gt;
&lt;li&gt;Modifying user roles and permissions.&lt;/li&gt;
&lt;li&gt;Managing product listings or prices (e.g., for e-commerce websites).&lt;/li&gt;
&lt;li&gt;Monitoring system logs or application performance.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;There are various ways these administrative tasks can be carried out. Common methods include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Remote management protocols&lt;/strong&gt; like SSH, PowerShell, RDP, or VNC.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Code and configuration files&lt;/strong&gt; for direct control over the system.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;APIs&lt;/strong&gt; that expose management functionality.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Browser-based admin panels&lt;/strong&gt; accessible via web consoles.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In this article, we’ll focus on &lt;strong&gt;browser-based admin panels&lt;/strong&gt;, the most common and vulnerable admin interface.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Exposed Admin Interfaces are a Major Risk
&lt;/h2&gt;

&lt;p&gt;An &lt;a href="https://www.thesmartscanner.com/vulnerability-list/unreferenced-login-page-found" rel="noopener noreferrer"&gt;exposed admin login page&lt;/a&gt; is a goldmine for hackers, offering a direct gateway to the heart of your website’s functionality and sensitive data. Many websites use default or easily guessable URLs for admin login pages, such as &lt;code&gt;/admin/&lt;/code&gt; or &lt;code&gt;/administrator/&lt;/code&gt;. Once hackers locate these pages, they can exploit vulnerabilities through attacks like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Brute force attacks&lt;/strong&gt;: Repeated attempts to guess passwords.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SQL injections&lt;/strong&gt;: Injecting malicious code to manipulate the database.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Session hijacking or redirection&lt;/strong&gt;: Taking over admin sessions.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Leaving your admin interface exposed is equivalent to leaving the front door of your house unlocked. But, by following certain security practices, you can significantly reduce the chances of a breach.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Protect Your Admin Interfaces
&lt;/h2&gt;

&lt;p&gt;Here are several actionable steps you can take to enhance the security of your administration panels:&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Separate Admin and User Interfaces
&lt;/h3&gt;

&lt;p&gt;Separate the standard user interface from the admin interface. This ensures that you can apply stricter security measures on the admin side without affecting user access. &lt;strong&gt;Hackers targeting user login pages won’t immediately have access to the administrative backend.&lt;/strong&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  2. Do Not Expose the Admin Interface on the Public Internet
&lt;/h3&gt;

&lt;p&gt;Wherever possible, avoid exposing your admin panel directly on the internet. One option is to &lt;strong&gt;restrict access to the admin interface through a VPN&lt;/strong&gt; or &lt;strong&gt;require physical network access&lt;/strong&gt;. Alternatively, you can implement a &lt;strong&gt;whitelisting mechanism&lt;/strong&gt; to limit access to specific IP addresses, drastically reducing the likelihood of unauthorized access.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Use HTTPS for Secure Communication
&lt;/h3&gt;

&lt;p&gt;Always use HTTPS to encrypt traffic between your admin panel and the client (browser). This prevents eavesdropping and protects admin credentials from being intercepted. Without HTTPS, attackers can easily capture sensitive information through a man-in-the-middle (MITM) attack.&lt;/p&gt;

&lt;h3&gt;
  
  
  4. Enforce Strong Password Policies
&lt;/h3&gt;

&lt;p&gt;Brute force attacks are one of the most common methods used to compromise login pages. Enforce a &lt;strong&gt;strong password policy&lt;/strong&gt; with complexity requirements (e.g., a mix of uppercase, lowercase, numbers, and special characters). Additionally, implement &lt;strong&gt;CAPTCHA&lt;/strong&gt; and &lt;strong&gt;account lockout mechanisms&lt;/strong&gt; to prevent automated &lt;a href="https://www.thesmartscanner.com/vulnerability-list/weak-password" rel="noopener noreferrer"&gt;password-guessing attempts&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  5. Implement Multi-Factor Authentication (MFA)
&lt;/h3&gt;

&lt;p&gt;Multi-factor authentication (MFA) provides an extra layer of security by requiring users to verify their identity through multiple factors—something they know (password), something they have (an OTP or security token), or something they are (biometric verification). MFA helps prevent unauthorized access, even if passwords are compromised.&lt;/p&gt;

&lt;h3&gt;
  
  
  6. Log and Monitor Admin Activities
&lt;/h3&gt;

&lt;p&gt;Enable &lt;strong&gt;detailed logging and monitoring&lt;/strong&gt; of admin activities. This allows you to track login attempts, suspicious behavior, or changes made in the admin panel. By actively monitoring these logs, you can detect and respond to potential threats in real-time, reducing the chances of an undetected breach.&lt;/p&gt;

&lt;h3&gt;
  
  
  7. Obscure the Admin URL
&lt;/h3&gt;

&lt;p&gt;If you must expose your admin interface to the internet, consider &lt;strong&gt;obscuring the URL&lt;/strong&gt;. Instead of using predictable paths like &lt;code&gt;/admin/&lt;/code&gt;, choose a non-standard, hard-to-guess URL (e.g., &lt;code&gt;/secret-dashboard-6421/&lt;/code&gt;). This practice, called &lt;strong&gt;security through obscurity&lt;/strong&gt;, is not a foolproof solution but can reduce the chances of automated or low-effort attacks.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: While obscuring URLs can help, it should not be your only defense. Hackers can still discover these URLs through more sophisticated methods.&lt;/em&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  8. Regularly Test and Secure Your Admin Interface
&lt;/h3&gt;

&lt;p&gt;Regular security testing is crucial to keeping your admin interface secure. Use a &lt;a href="https://www.thesmartscanner.com/" rel="noopener noreferrer"&gt;&lt;strong&gt;web application security scanner&lt;/strong&gt;&lt;/a&gt; to scan for vulnerabilities such as &lt;strong&gt;outdated software, improper permissions, directory listings&lt;/strong&gt;, or &lt;strong&gt;weak configurations&lt;/strong&gt;. For example, a &lt;a href="https://www.thesmartscanner.com/vulnerability-list/referrer-policy-header-is-missing" rel="noopener noreferrer"&gt;missing &lt;strong&gt;referrer policy&lt;/strong&gt;&lt;/a&gt; could unintentionally leak your admin URLs in outgoing requests. Fixing these vulnerabilities can prevent hackers from exploiting them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Hiding your admin login page is a simple but effective step in reducing your website’s risk of being compromised. However, obscuring the URL is just the beginning. By following the comprehensive guidelines outlined in this article, you can significantly strengthen the security of your admin interface.&lt;/p&gt;

&lt;p&gt;From using HTTPS and strong passwords to implementing multi-factor authentication and regular security scans, these actions will help protect your website from malicious attacks.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Remember: Security is an ongoing process, not a one-time task. Continuously scan and fix any vulnerabilities in your web application to stay ahead of evolving threats.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To help with this, you can &lt;a href="https://www.thesmartscanner.com/download" rel="noopener noreferrer"&gt;download and use &lt;strong&gt;SmartScanner&lt;/strong&gt;&lt;/a&gt;, a web application security scanner, to test your website for vulnerabilities — completely free of charge. Don’t wait until it’s too late, &lt;a href="https://www.thesmartscanner.com/" rel="noopener noreferrer"&gt;secure your website now!&lt;/a&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>web</category>
      <category>webdev</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Online Robots.txt Validator For Creating a Secure Robots.txt</title>
      <dc:creator>SmartScanner</dc:creator>
      <pubDate>Tue, 31 Oct 2023 21:04:56 +0000</pubDate>
      <link>https://forem.com/smartscanner/online-robotstxt-validator-for-creating-a-secure-robotstxt-3pgo</link>
      <guid>https://forem.com/smartscanner/online-robotstxt-validator-for-creating-a-secure-robotstxt-3pgo</guid>
      <description>&lt;p&gt;A robots.txt file is a small but important part of a website. It is a plain text file that is placed in the root directory of a website and is used to communicate with search engine crawlers, telling them which pages or sections of a site should or should not be indexed.&lt;/p&gt;

&lt;h2&gt;
  
  
  TLDR
&lt;/h2&gt;

&lt;p&gt;Use the &lt;a href="https://www.thesmartscanner.com/tools/robotstxt"&gt;online robots.txt validator&lt;/a&gt; to make sure your robots.txt is well formatted and has no security risk.&lt;/p&gt;

&lt;p&gt;The robots.txt file is a set of instructions that tell web crawlers which parts of a website they are allowed to access. These web crawlers are automated programs that scan websites to gather information about the pages and content on a site. While these crawlers can help index a website and make it more visible in search engine results, they can also consume a lot of server resources and bandwidth if they are not properly managed. Not every robot out there is good. That's why having a properly written robots.txt file is very important.&lt;/p&gt;

&lt;p&gt;The structure of a robots.txt file is relatively simple but it is also hard to debug and make sure it's working as expected. But with our new online &lt;a href="https://www.thesmartscanner.com/tools/robotstxt"&gt;tool&lt;/a&gt; for validating robots.txt it's easy to create one.&lt;/p&gt;

&lt;p&gt;You can simply copy and paste your robots.txt contents into this tool and check possible errors. Then you can easily fix the problems with recommendations provided for each issue.&lt;/p&gt;

&lt;h2&gt;
  
  
  Security Issues in Robots.txt
&lt;/h2&gt;

&lt;p&gt;There's a misunderstanding that a robots.txt file can be used for protecting sensitive files on a website. That's &lt;a href="https://www.thesmartscanner.com/blog/is-your-robots-txt-file-vulnerable-here-s-how-to-check-and-secure-it"&gt;why many websites disclose valuable information&lt;/a&gt; to hackers. One benefit of our online &lt;a href="https://www.thesmartscanner.com/tools/robotstxt"&gt;robots.txt checker&lt;/a&gt; is that it can also check for security-related problems in robots.txt.&lt;/p&gt;

&lt;p&gt;The online robots.txt validator can detect up to 19 problems. In the following, we explain some common security vulnerabilities that can be found in a robots.txt file.&lt;/p&gt;

&lt;h2&gt;
  
  
  File Disclosure in Disallow
&lt;/h2&gt;

&lt;p&gt;It happens when you add a &lt;code&gt;disallow&lt;/code&gt; record with a full file path.&lt;br&gt;
The robots.txt is a voluntary mechanism. It's not sufficient to guarantee some robots will not visit restricted URLs. In fact, malicious users can use robots.txt to find out the resources you are trying to hide; like a &lt;a href="https://www.thesmartscanner.com/vulnerabilities/unreferenced-login-page-found"&gt;login page&lt;/a&gt;.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to Fix
&lt;/h3&gt;

&lt;p&gt;You should not use the disallow rule for protecting files. Following are some alternatives:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Use strong authentication&lt;/strong&gt;: For sensitive resources on your website you must use strong authentication and access control mechanisms.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;You don't need to disallow at all&lt;/strong&gt;: If the file in the &lt;code&gt;disallow&lt;/code&gt; rule is not linked to your website, you don't need a disallow for it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use &lt;code&gt;noindex&lt;/code&gt; meta tag&lt;/strong&gt;: If you only want to prevent search engines from indexing your URL, you can use the &lt;code&gt;noindex&lt;/code&gt; ruleset. &lt;code&gt;noindex&lt;/code&gt; is a rule set with either a &lt;code&gt;&amp;lt;meta&amp;gt;&lt;/code&gt; tag or HTTP response header and is used to prevent indexing content by search engines that support the &lt;code&gt;noindex&lt;/code&gt; rule, such as Google.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Use pattern&lt;/strong&gt;: Instead of revealing the full path, use patterns in the disallow rule. for example, use &lt;code&gt;disallow: /*.php&lt;/code&gt; to exclude all php file&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Directory Disclosure in Disallow
&lt;/h2&gt;

&lt;p&gt;Revealing directories like &lt;code&gt;/admin/&lt;/code&gt; in the disallow rule gives hackers a clue to start digging in that directory.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to Prevent
&lt;/h3&gt;

&lt;p&gt;In addition to the above recommendations, you should make sure &lt;a href="https://www.thesmartscanner.com/vulnerability-list/directory-listing"&gt;directory listing&lt;/a&gt; is disabled on your website.&lt;/p&gt;

&lt;h2&gt;
  
  
  Possible Path Disclosure in Allow
&lt;/h2&gt;

&lt;p&gt;By revealing URLs in the &lt;code&gt;allow&lt;/code&gt; rule, you &lt;a href="https://www.thesmartscanner.com/vulnerability-list/sensitive-unreferenced-resource-found"&gt;disclose resources to malicious users&lt;/a&gt;. You must make sure these URLs are not sensitive.&lt;/p&gt;

&lt;h3&gt;
  
  
  How to Avoid
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Make sure you're not revealing any sensitive resources.&lt;/li&gt;
&lt;li&gt;Make sure revealed folders do not display a directory listing.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;A robots.txt file is a vital aspect of website management and by properly configuring it, website owners can protect sensitive information and ensure that their site is effectively managed.&lt;/p&gt;

&lt;p&gt;Go ahead and &lt;a href="https://www.thesmartscanner.com/tools/robotstxt"&gt;test your robots.txt now&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>security</category>
      <category>webdev</category>
      <category>webscraping</category>
      <category>website</category>
    </item>
    <item>
      <title>Web Scanner, A Must Have Tool For Web Developers</title>
      <dc:creator>SmartScanner</dc:creator>
      <pubDate>Sat, 23 Sep 2023 18:51:32 +0000</pubDate>
      <link>https://forem.com/smartscanner/web-scanner-a-must-have-tool-for-web-developers-5geb</link>
      <guid>https://forem.com/smartscanner/web-scanner-a-must-have-tool-for-web-developers-5geb</guid>
      <description>&lt;p&gt;A review about web scanners and how they can be a secret weapon to gain competitive advantage for developers.&lt;/p&gt;

&lt;p&gt;As the internet grows and technology advances, web development has become more complex, and so has web security. Web developers must use tools that can help them ensure that their websites are secure. Let's see how using a web scanner can help with that.&lt;/p&gt;

&lt;h2&gt;
  
  
  Web Scanners in Developer's Toolset
&lt;/h2&gt;

&lt;p&gt;Web development is a challenging job that requires a solid understanding of programming languages, web development frameworks, and emerging technologies. Web developers are responsible for different aspects of a web application, including interface design, information architecture, and website performance optimization. Collaboration with other developers, designers, and stakeholders can add extra complexity to the development process.&lt;/p&gt;

&lt;p&gt;Web developers use various tools to create and maintain websites, including text editors, IDEs, version control systems, and testing frameworks. However, one tool that is often overlooked is a web scanner.&lt;/p&gt;

&lt;p&gt;A web scanner is a tool that can detect security vulnerabilities in web applications. It is an essential tool for web developers to ensure website security.&lt;/p&gt;

&lt;h2&gt;
  
  
  Benefits of Using a Web Security Scanner For Developers
&lt;/h2&gt;

&lt;p&gt;Web developers have numerous responsibilities, including the creation of secure applications. However, web security is a complex domain that requires a different skill set and extensive experience to become an expert. Security testing of web applications requires knowledge beyond web development. Using a web scanner can assist web developers in identifying and resolving security vulnerabilities.&lt;/p&gt;

&lt;p&gt;Here are some benefits of using a web scanner for web developers.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;It &lt;strong&gt;saves time and effort&lt;/strong&gt; by quickly and accurately scanning websites, allowing developers to focus on other aspects of website development.&lt;/li&gt;
&lt;li&gt;Web scanners can &lt;strong&gt;improve a developer's skills&lt;/strong&gt; by exposing them to new vulnerabilities and best practices for resolving them.&lt;/li&gt;
&lt;li&gt;It can &lt;strong&gt;boost productivity&lt;/strong&gt; by automating much of the testing process, enabling developers to spend more time developing new features or improving existing ones.&lt;/li&gt;
&lt;li&gt;Web scanners can also &lt;strong&gt;enhance a developer's reputation&lt;/strong&gt; by demonstrating a commitment to website security.&lt;/li&gt;
&lt;li&gt;It can help developers &lt;strong&gt;avoid legal issues&lt;/strong&gt; by ensuring compliance with industry regulations and standards.&lt;/li&gt;
&lt;li&gt;Web scanners can &lt;strong&gt;identify security issues before they become a problem&lt;/strong&gt;, which is crucial because it is much easier and cheaper to &lt;a href="https://www.thesmartscanner.com/blog/how-do-hackers-hack"&gt;fix security issues before they are exploited by hackers&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;By using a web scanner, developers can &lt;strong&gt;improve user experience&lt;/strong&gt; by identifying and fixing security issues that may affect the UX of a website.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  How to Test Security of Your Web Application With a Web Scanner
&lt;/h2&gt;

&lt;p&gt;Several types of security testing are commonly used to identify and address security vulnerabilities in web applications. Penetration Testing, Source Code Analysis, and Vulnerability Scanning are common types of security testing. Manually conducting these tests requires a lot of knowledge and experience. If you're not a security expert, you can still &lt;a href="https://www.thesmartscanner.com/blog/5-security-vulnerabilities-you-can-fix-right-now"&gt;perform security testing of your web application&lt;/a&gt;. All you need is the right tool. For instance, you can use a web scanner or a DAST tool.&lt;/p&gt;

&lt;p&gt;DAST stands for &lt;em&gt;Dynamic Application Security Testing&lt;/em&gt;, which is a type of security testing that involves testing the security of an application while it is running in a live environment.&lt;/p&gt;

&lt;p&gt;There are many Web Scanners that can do a DAST on your website. Following is a list of top free web scanners.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://www.zaproxy.org/"&gt;OWASP ZAP&lt;/a&gt;&lt;/strong&gt;: Free and open source. Actively maintained by a dedicated international team of volunteers.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://subgraph.com/vega/"&gt;Vega&lt;/a&gt;&lt;/strong&gt;: Web security testing platform to test the security of web applications.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://wapiti-scanner.github.io/"&gt;Wapiti&lt;/a&gt;&lt;/strong&gt;: Wapiti allows you to audit the security of your websites or web applications.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;a href="https://www.theSmartScanner.com"&gt;SmartScanner - Website Vulnerability Scanner&lt;/a&gt;&lt;/strong&gt;: While other tools may not be as user-friendly, SmartScanner stands out for its simplicity and intuitive interface.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Using SmartScanner for Automated Web Security Test
&lt;/h2&gt;

&lt;p&gt;SmartScanner is a DAST tool that scans websites for vulnerabilities and security issues. It uses Artificial Intelligence, &lt;a href="https://www.thesmartscanner.com/blog/why-you-should-use-passive-vulnerability-scan-on-your-website"&gt;passive scanning&lt;/a&gt; and active methods to identify security issues. SmartScanner can check for a range of security issues, including SQL injection, cross-site scripting (XSS), and other vulnerabilities.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--FD-eAl20--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e5m41zqqz0ofcp3j08c1.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--FD-eAl20--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_66%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e5m41zqqz0ofcp3j08c1.gif" alt="Scanning website security with SmartScanner" width="736" height="455"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SmartScanner is easy to use, and it automatically browses your application, navigates to different pages, runs JavaScripts, and fetches remote APIs to find web vulnerabilities. SmartScanner provides reports specific details for every vulnerability along with remediation and mitigation steps so you can fix vulnerabilities easily.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.TheSmartScanner.com/download"&gt;Download SmartScanner, scan your website&lt;/a&gt;, and discover your web security problems.&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>testing</category>
      <category>security</category>
      <category>devops</category>
    </item>
    <item>
      <title>Secure Coding 101: How to Read and Write Files Securely</title>
      <dc:creator>SmartScanner</dc:creator>
      <pubDate>Thu, 10 Aug 2023 06:58:00 +0000</pubDate>
      <link>https://forem.com/smartscanner/secure-coding-101-how-to-read-and-write-files-securely-2827</link>
      <guid>https://forem.com/smartscanner/secure-coding-101-how-to-read-and-write-files-securely-2827</guid>
      <description>&lt;p&gt;Working with files is a common requirement in many applications, but it also introduces several potential security vulnerabilities. In this article, we will explore how to securely work with files in your application.&lt;/p&gt;

&lt;p&gt;Let's review common vulnerabilities and mitigations when working file files.&lt;/p&gt;

&lt;h2&gt;
  
  
  TLDR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;File Inclusions and Path Traversal vulnerabilities are the results of insecure accessing files&lt;/li&gt;
&lt;li&gt;Avoid accessing file paths that are built with user-provided input&lt;/li&gt;
&lt;li&gt;If you must use inputs from users in file paths, use a strict whitelist for allowed user inputs and reject non-compliant inputs&lt;/li&gt;
&lt;li&gt;Use libraries to detect if the file you're going to access is in the intended directory (e.g. &lt;code&gt;realpath()&lt;/code&gt; in PHP and NodeJs)&lt;/li&gt;
&lt;li&gt;When creating files (e.g. file uploads) set a reasonable file size limit&lt;/li&gt;
&lt;li&gt;When writing user-provided content, make sure the content type is what you expect&lt;/li&gt;
&lt;li&gt;When creating files, make sure they don't have execution permission&lt;/li&gt;
&lt;li&gt;When creating files, make sure they're not publicly accessible&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  File Inclusion Vulnerability
&lt;/h2&gt;

&lt;p&gt;File inclusion vulnerability is a type of web vulnerability that occurs when an application allows a user to include a file in the output of a web page without properly validating or sanitizing the user input.&lt;/p&gt;

&lt;p&gt;There are two types of &lt;a href="https://www.thesmartscanner.com/vulnerability-list/remote-file-inclusion"&gt;file inclusion vulnerabilities&lt;/a&gt;: &lt;em&gt;Local File Inclusion (LFI)&lt;/em&gt; and &lt;em&gt;Remote File Inclusion (RFI)&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;LFI occurs when an attacker can include a file from the local file system of the server. This can allow the attacker to view sensitive files or execute arbitrary code on the server.&lt;/p&gt;

&lt;p&gt;RFI occurs when an attacker can include a file from a remote server. This can allow the attacker to execute arbitrary code on the server or steal sensitive information.&lt;/p&gt;

&lt;p&gt;For example, consider the following vulnerable PHP code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$module&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$_GET&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'module'&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="k"&gt;include&lt;/span&gt; &lt;span class="nv"&gt;$module&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This code retrieves a value from the URL query string using the &lt;code&gt;$_GET&lt;/code&gt; superglobal, specifically the "module" parameter. The retrieved value is then used as the file path to include a PHP file using the &lt;code&gt;include&lt;/code&gt; statement. This means that the contents of the specified file will be included in the current script at the point where the &lt;code&gt;include&lt;/code&gt; statement appears.&lt;/p&gt;

&lt;p&gt;However, this code can be potentially dangerous to both LFI and RFI.&lt;/p&gt;

&lt;p&gt;In the above PHP code example, a user can pass any file name or URL as the &lt;code&gt;module&lt;/code&gt; parameter. For instance, an attacker can host a PHP script on their server and pass its URL, like &lt;code&gt;http://attackerhost/phpscript.txt&lt;/code&gt;, in the module parameter and execute arbitrary commands on the target system.&lt;/p&gt;

&lt;p&gt;In PHP, for example, file inclusion vulnerabilities are often caused by the use of the &lt;code&gt;include&lt;/code&gt; or &lt;code&gt;require&lt;/code&gt; functions without proper input validation. Similarly, in JSP, file inclusion vulnerabilities can occur when the &lt;code&gt;include&lt;/code&gt; or &lt;code&gt;jsp:include&lt;/code&gt; tags are used without proper input validation. Using &lt;code&gt;Server.Execute&lt;/code&gt; or &lt;code&gt;Server.Transfer&lt;/code&gt; in ASP also can create file inclusion vulnerabilities.&lt;/p&gt;

&lt;h2&gt;
  
  
  Local File Download
&lt;/h2&gt;

&lt;p&gt;Suppose an application has a file download functionality that allows users to download a file from the server. The application takes a file name as a parameter and returns the file contents to the user. If the application does not validate the file name parameter and allows users to download any file on the server, an attacker can exploit this vulnerability by passing a sensitive file name as the parameter. This is called &lt;em&gt;Local File Download&lt;/em&gt; or &lt;em&gt;Local File Disclosure&lt;/em&gt; vulnerability.&lt;/p&gt;

&lt;p&gt;In our example, if the user passes &lt;code&gt;/etc/passwd&lt;/code&gt; as a module parameter, the content of &lt;code&gt;passwd&lt;/code&gt; file is displayed to the user.&lt;/p&gt;

&lt;p&gt;Local file download is a very common vulnerability and can be found in any programming language.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prevent File Inclusion Vulnerabilities
&lt;/h3&gt;

&lt;p&gt;Follow below best practices to mitigate File Inclusion vulnerabilities:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Do not include or open files that are built using user-provided data&lt;/li&gt;
&lt;li&gt;If you must use inputs from users in file paths, use a strict whitelist for allowed user inputs and reject non-compliant inputs&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Path Traversal Vulnerability
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;Path traversal&lt;/em&gt; vulnerability, also known as &lt;em&gt;directory traversal&lt;/em&gt; vulnerability, is another web security vulnerability that allows attackers to access files outside of the intended directory. An attacker can exploit this vulnerability to access sensitive files, such as configuration files, password files, and even source code files.  &lt;/p&gt;

&lt;p&gt;This vulnerability occurs when you create file paths using invalidated user input. This allows the attacker to navigate to directories and files using the &lt;code&gt;../&lt;/code&gt; character sequences. The &lt;code&gt;../&lt;/code&gt; character sequences refer to the parent directory on file systems.&lt;/p&gt;

&lt;p&gt;Consider below revised version of our vulnerable PHP code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="nv"&gt;$module&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nv"&gt;$_GET&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'module'&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="k"&gt;include&lt;/span&gt; &lt;span class="s1"&gt;'./'&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt; &lt;span class="nv"&gt;$module&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;By prefixing the module variable with &lt;code&gt;./&lt;/code&gt; character sequences, we're limiting file inclusion to the current directory only. So users cannot pass absolute file names like &lt;code&gt;/etc/passwd&lt;/code&gt; or URLs that will eliminate RFI. But the user can enter &lt;code&gt;../../../../../../../etc/passwd&lt;/code&gt; as module parameter value and the final file path would resolve to &lt;code&gt;/etc/passwd&lt;/code&gt;. This will reveal the contents of the passwd file.&lt;/p&gt;

&lt;p&gt;The Path traversal vulnerability can occur in any programming language and also in Windows operating systems.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prevent Path Traversal Vulnerability
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Do not include or open files that are built using user-provided data&lt;/li&gt;
&lt;li&gt;If you must use inputs from users in file paths, use a strict whitelist for allowed user inputs and reject non-compliant inputs&lt;/li&gt;
&lt;li&gt;Use libraries to detect if the file you're going to access is in the intended directory (e.g. &lt;code&gt;realpath()&lt;/code&gt; in PHP and NodeJs)&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  File Upload Vulnerability
&lt;/h2&gt;

&lt;p&gt;When it comes to uploading files, security is paramount. Unfortunately, there is a severe vulnerability called &lt;em&gt;arbitrary file upload&lt;/em&gt; that can compromise your data. This vulnerability allows users to upload any type of file, including scripts like PHP, Python, or ASP code, which can execute any command on your server.&lt;/p&gt;

&lt;p&gt;In addition to arbitrary file upload, insecure file upload functionality can also introduce other vulnerabilities like &lt;em&gt;Denial of Service (DoS)&lt;/em&gt; attacks. For example, if you don't set a limit on the file size that can be uploaded, an attacker could upload an excessively large file and potentially cause a DoS attack or consume excessive server resources.&lt;/p&gt;

&lt;p&gt;Furthermore, insecure file uploads can allow attackers to override sensitive files using path traversal or upload malware to your server.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prevent Insecure File Uploads
&lt;/h3&gt;

&lt;p&gt;To prevent file upload vulnerabilities from happening, implement the following measures:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Set a reasonable file size limit and validate that uploaded files are within that limit.&lt;/li&gt;
&lt;li&gt;Validate that uploaded files are of the expected file type and reject any files that are not.&lt;/li&gt;
&lt;li&gt;Use randomly generated file names for storing uploaded files. If you have to use user-provided filenames, use a white list filter for accepted file names and reject other file names.&lt;/li&gt;
&lt;li&gt;Use reputable anti-virus or malware detection software to scan uploaded files before they are processed or stored on your server.&lt;/li&gt;
&lt;li&gt;Make sure uploaded files do not have execution permission.&lt;/li&gt;
&lt;li&gt;Make sure only required users have access to the uploaded files.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Check out SmartScanner website for a &lt;a href="https://www.thesmartscanner.com/download"&gt;Free Vulnerability Scanner&lt;/a&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>php</category>
      <category>node</category>
      <category>beginners</category>
    </item>
    <item>
      <title>Secure Coding 101: How to Use Random Function</title>
      <dc:creator>SmartScanner</dc:creator>
      <pubDate>Wed, 10 May 2023 07:50:30 +0000</pubDate>
      <link>https://forem.com/smartscanner/secure-coding-101-how-to-use-random-function-50hp</link>
      <guid>https://forem.com/smartscanner/secure-coding-101-how-to-use-random-function-50hp</guid>
      <description>&lt;p&gt;Random numbers are everywhere on the web, and your security depends on them. Let's see if you're using them right.&lt;/p&gt;

&lt;p&gt;Random numbers play a critical role in web application security. They are used in session identifiers, passwords, cryptographic keys, and more. However, if not implemented securely, they can lead to vulnerabilities that attackers can exploit to gain unauthorized access to sensitive information.&lt;/p&gt;

&lt;h2&gt;
  
  
  TLDR
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Most random generators are not really random. They use math that looks random&lt;/li&gt;
&lt;li&gt;Do not use &lt;code&gt;Math.random()&lt;/code&gt; in JavaScript or &lt;code&gt;random&lt;/code&gt; in Python&lt;/li&gt;
&lt;li&gt;Use &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API"&gt;&lt;code&gt;Web Crypto API&lt;/code&gt;&lt;/a&gt; in JavaScript, &lt;a href="https://nodejs.org/api/crypto.html"&gt;&lt;code&gt;crypto&lt;/code&gt;&lt;/a&gt; module in NodeJs, and &lt;a href="https://docs.python.org/3/library/secrets.html"&gt;&lt;code&gt;secrets&lt;/code&gt;&lt;/a&gt; in python&lt;/li&gt;
&lt;li&gt;Do not try to implement your own random generation algorithm&lt;/li&gt;
&lt;li&gt;Incorrect usage of secure random numbers can make your application vulnerable&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How Random Functions work
&lt;/h2&gt;

&lt;p&gt;There are two main types of Random Number Generators (RNGs): pseudo-random number generators (PRNGs) and true random number generators (TRNGs).&lt;/p&gt;

&lt;h3&gt;
  
  
  Pseudo-random Number Generators (PRNGs)
&lt;/h3&gt;

&lt;p&gt;PRNGs are the most commonly used type of RNGs. They work by using an algorithm to generate a sequence of numbers that appear to be random. The algorithm takes an initial value as input and produces a series of numbers based on it.&lt;/p&gt;

&lt;p&gt;The common algorithms used in PRNGs are the &lt;a href="https://en.wikipedia.org/wiki/Mersenne_Twister"&gt;Mersenne-Twister&lt;/a&gt; and &lt;a href="https://en.wikipedia.org/wiki/Linear_congruential_generator"&gt;linear congruential generator (LCG)&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;These algorithms get an initial number called &lt;code&gt;seed&lt;/code&gt;. They change it by adding previous random number, shifting, and doing XOR operators to generate the output. The output looks like a random number though it's just an output of a formula.&lt;/p&gt;

&lt;p&gt;If you keep executing any PRNG, it will eventually generate the same numbers over and over. Any PRNG has a fixed length of numbers that can generate before starting over.&lt;/p&gt;

&lt;h3&gt;
  
  
  True Random Number Generators (TRNGs)
&lt;/h3&gt;

&lt;p&gt;TRNGs generate truly random numbers based on physical processes that are inherently random. These processes include atmospheric noise, radioactive decay, and thermal noise. TRNGs measure the physical process and convert it into a random number.&lt;/p&gt;

&lt;h2&gt;
  
  
  Random Function Vulnerabilities
&lt;/h2&gt;

&lt;p&gt;The seed and random number generation algorithm both can have weaknesses.&lt;/p&gt;

&lt;h3&gt;
  
  
  Prediction
&lt;/h3&gt;

&lt;p&gt;You can say predictability is the main vulnerability of weak random number generators. PRNGs are inherently predictable as they are based on a mathematical formula. So if you know the seed and last random number, you can predict the next random number. This can lead to severe vulnerabilities.&lt;/p&gt;

&lt;p&gt;For example, consider a forget password functionality that words based on a random token. If the token can be predicted, an attacker can reset the password of any user.&lt;/p&gt;

&lt;h3&gt;
  
  
  Collision
&lt;/h3&gt;

&lt;p&gt;Besides the predictability, Some random generators that have low quality produce duplicate values very often. This can increase the risk of collision.&lt;/p&gt;

&lt;p&gt;Consider an application that generates random session tokens for its users. The chances of producing duplicate session tokens are related to two factors:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Size of random space (length of session token)&lt;/li&gt;
&lt;li&gt;Quality of the random selection&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Short-length tokens will have a higher chance of collisions. And bad random generator does not generate all possible values. This can lead to vulnerabilities where a user can see another user's data.&lt;/p&gt;

&lt;h3&gt;
  
  
  Seed Leakage or Manipulation
&lt;/h3&gt;

&lt;p&gt;Another vulnerability related to random number generators is choosing a weak seed. PRNG always generates the same sequence of numbers with the same initial seed value. If an attacker can find the used seed or manipulate it, he can easily generate same random numbers.&lt;/p&gt;

&lt;p&gt;In pratice, hackers use different methods to predict the next random number. Some methods may involve statistical analysis, while others may involve reverse-engineering the generator's algorithm.&lt;/p&gt;

&lt;h2&gt;
  
  
  How to Use Secure Random Numbers
&lt;/h2&gt;

&lt;p&gt;Using cryptographically secure random number generation algorithms is the key to securely producing random numbers. These algorithms generate random numbers that are unpredictable and cannot be easily guessed by attackers. The output of these algorithms is resistant to brute-force attacks, and it's statistically robust.&lt;br&gt;
You should not try to implement your own one unless you know what you are doing. Instead, always use known to be secure random libraries. &lt;/p&gt;

&lt;p&gt;Let's see a few examples of using secure random libraries in different programming languages.&lt;/p&gt;
&lt;h3&gt;
  
  
  Javascript
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;Math.random()&lt;/code&gt; function is not suitable for cryptographic purposes, as it is not truly random and can be predicted or manipulated by an attacker.&lt;/p&gt;

&lt;p&gt;To generate a secure random number in JavaScript, you can use the &lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API"&gt;&lt;code&gt;Web Crypto API&lt;/code&gt;&lt;/a&gt;. The &lt;code&gt;Crypto.getRandomValues()&lt;/code&gt; method lets you get cryptographically strong random values. Here is an example code that generates a secure random number:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;generateRandomNumber&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;array&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Uint32Array&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Create a 32-bit unsigned integer array  &lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="nb"&gt;window&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getRandomValues&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;array&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Fill the array with random values  &lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;array&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt; &lt;span class="c1"&gt;// Return the first element of the array as the random number  &lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;generateRandomNumber&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt; &lt;span class="c1"&gt;// Output a random number between 0 and 4294967295&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  NodeJS
&lt;/h3&gt;

&lt;p&gt;In NodeJS, the &lt;a href="https://nodejs.org/api/crypto.html"&gt;&lt;code&gt;crypto&lt;/code&gt;&lt;/a&gt; module can be used to generate cryptographically secure random numbers. The following code sample illustrates the use of crypto module in generating a random number:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;crypto&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;crypto&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nx"&gt;generateRandomNumber&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;randomBytes&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;crypto&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;randomBytes&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;4&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Generate 4 random bytes  &lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;hexValue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;randomBytes&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;hex&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Convert the bytes to a hex string  &lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;intValue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;parseInt&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;hexValue&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// Convert the hex string to an integer  &lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nx"&gt;intValue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;generateRandomNumber&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt; &lt;span class="c1"&gt;// Output a random number between 0 and 4294967295&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Python
&lt;/h3&gt;

&lt;p&gt;In Python, the &lt;code&gt;random&lt;/code&gt; module can be used to generate random numbers. However, it is not cryptographically secure. Instead, you can use the &lt;a href="https://docs.python.org/3/library/secrets.html"&gt;&lt;code&gt;secrets&lt;/code&gt;&lt;/a&gt; module to generate cryptographically secure random numbers. The following code sample illustrates the use of secrets module in generating a random number:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;secrets&lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;generate_random_number&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="err"&gt;   &lt;/span&gt; &lt;span class="n"&gt;random_number&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;secrets&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;randbits&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="c1"&gt;# Generate a 32-bit random number  
&lt;/span&gt;&lt;span class="err"&gt;   &lt;/span&gt; &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;random_number&lt;/span&gt; &lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="err"&gt; &lt;/span&gt;
&lt;span class="k"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;generate_random_number&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt; &lt;span class="c1"&gt;# Output a random number between 0 and 4294967295
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Random numbers in computers are mathematical formulas and predictable. Not every random number generator is suitable for cryptography and security usage. Random numbers are just one element in security system design and implementation. There are many other things like seed generation, key management, and overall security system design that are extremely important and hard to get right. The &lt;a href="https://www.crypto101.io/"&gt;Crypto 101&lt;/a&gt; is a great place to start learning more about cryptography.&lt;/p&gt;

&lt;p&gt;Read more on &lt;a href="https://www.thesmartscanner.com/blog/"&gt;SmartScanner Security Blog&lt;/a&gt;.&lt;/p&gt;

</description>
      <category>security</category>
      <category>cryptography</category>
      <category>javascript</category>
      <category>node</category>
    </item>
    <item>
      <title>3 reasons why any website's security is important</title>
      <dc:creator>SmartScanner</dc:creator>
      <pubDate>Mon, 09 Jan 2023 11:53:24 +0000</pubDate>
      <link>https://forem.com/smartscanner/3-reasons-why-any-websites-security-is-important-1m52</link>
      <guid>https://forem.com/smartscanner/3-reasons-why-any-websites-security-is-important-1m52</guid>
      <description>&lt;p&gt;You might think that security is important but only for big companies. This article is going to change your mind.&lt;/p&gt;

&lt;h2&gt;
  
  
  Hacked website can affect your audience
&lt;/h2&gt;

&lt;p&gt;Security is critical as long as you have any visitor on your website (actually, security is vital even if you don't have any visitor at all, you'll see!).&lt;/p&gt;

&lt;p&gt;Either recruiters on your personal project portfolio website or customers on your online shopping platform, it doesn't matter who you are targeting on your website. Any of your website visitors can be targeted by hackers as well if you don't make your website secure.&lt;/p&gt;

&lt;p&gt;Your website can have many vulnerabilities, and any of them would be sufficient for hackers to compromise your website to use it against your visitors. Security vulnerabilities like &lt;a href="https://www.thesmartscanner.com/vulnerability-list/cross-site-scripting"&gt;XSS&lt;/a&gt;, &lt;a href="https://www.thesmartscanner.com/vulnerability-list/sql-injection"&gt;SQLI&lt;/a&gt; or &lt;a href="https://www.thesmartscanner.com/vulnerability-list/local-file-inclusion"&gt;File Inclusions&lt;/a&gt; allow hackers to take control over what your visitors see on your website. These vulnerabilities can exist on any page, or they might be in your web server's configurations or even in an outdated WordPress plugin.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why should hackers hack my website?
&lt;/h3&gt;

&lt;p&gt;Hackers take over your website to do any of below malicious tasks.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://thehackernews.com/2022/04/over-16500-sites-hacked-to-distribute.html"&gt;Distributing malwares&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Stealing your customers data&lt;/li&gt;
&lt;li&gt;Making your web server a zombie and using it in DDOS attacks against other targets&lt;/li&gt;
&lt;li&gt;Mining cryptocurrencies using your web server or your visitor's CPU power&lt;/li&gt;
&lt;li&gt;Using your servers for running software like proxy or spammers.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can see that even if no one visits your website, security is still essential because hackers can abuse your web server against inocent targets. Or, you might receive a costly bill from your hosting service because a hacker is using too much CPU power on your server to mine cryptocurrencies.&lt;/p&gt;

&lt;h2&gt;
  
  
  Reputation loss
&lt;/h2&gt;

&lt;p&gt;You run a website for a reason. It could be revenue, finding a job or being creative. A hacked website impacts your reputation. Bad reputations results in less visitors, less trust and less revenue or job interviews.&lt;/p&gt;

&lt;p&gt;Besides, not having a secure website has negative SEO impact. Google and other search engines penalize websites without SSL Certificate. If your site has &lt;a href="https://www.thesmartscanner.com/vulnerability-list/no-https"&gt;no HTTPS&lt;/a&gt; and your competition does, Google punishes your websites, and your competitor website come up higher on Google search results than you are. Google Chrome also displays a red "Not secure" note in address bar for sites without SSL.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lNFn6UrM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/898unaxmpe76nx7cpwvo.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lNFn6UrM--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/898unaxmpe76nx7cpwvo.jpg" alt="Google Chrome displaying alert for non-https sites" width="768" height="351"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hacked website is a thread to visitors, so it's no surprise to see that &lt;a href="https://www.blog.google/products/search/search-spam-report-2017/"&gt;Google removes hacked website from search results&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;When your website gets hacked, it can be added to specific black-lists like Google Safe Browsing list. The Safe Browsing lists—also referred to as threat lists or simply lists—are Google's constantly updated lists of unsafe web resources. Many applications like browsers use these lists to prevent users from accessing a hacked website.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--YK3Cvsb2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mp8iv04muuc7b3q8okcc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--YK3Cvsb2--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mp8iv04muuc7b3q8okcc.png" alt="Google Chrome warning user about deceptive site" width="768" height="477"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If your visitors get warned about security of your website, the chances are extremely low that they will buy on your website, invite you to interview or visit your site anyhow.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prevention is better than cure
&lt;/h2&gt;

&lt;p&gt;OK, you got hacked! Now you have to clean up your website, restore your backup, remove your website from black-lists and inform your users. You lost your customers and revenue untill you've rebuilt the trust and reputation. That's a enormous task to recover from a security incident, and it will cost you time and money.&lt;/p&gt;

&lt;p&gt;In most cases recovery and fixing a hacked website is a complex task that requires experts to do it manually, and of course it will not be for free.&lt;/p&gt;

&lt;h2&gt;
  
  
  How vulnerable is your website?
&lt;/h2&gt;

&lt;p&gt;Hackers look for low hanging fruits. They look for high risk vulnerabilities in many websites (because any website can be usefull). Read more about hacker methods on &lt;a href="https://www.thesmartscanner.com/blog/how-do-hackers-hack"&gt;how hackers hack&lt;/a&gt; article.&lt;/p&gt;

&lt;p&gt;Good news is you can be like hackers. You can find holes in your website before hackers find them.&lt;/p&gt;

&lt;p&gt;Testing security of your website is easy. There are dozen of web security testing tools out there you can use for free. &lt;a href="https://www.arachni-scanner.com/"&gt;Arachni&lt;/a&gt; and &lt;a href="https://w3af.org/"&gt;w3af&lt;/a&gt; are famous open source security scanners you can use.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://www.thesmartscanner.com/"&gt;SmartScanner&lt;/a&gt; is an AI powered web security scanner aimed to be easy to use for everyone. &lt;a href="https://www.thesmartscanner.com/download"&gt;Download&lt;/a&gt; and enter your website address for a free scan to find out about security of your website.&lt;/p&gt;

</description>
      <category>security</category>
      <category>webdev</category>
      <category>startup</category>
      <category>wordpress</category>
    </item>
    <item>
      <title>Update Cheat Sheet for Developers</title>
      <dc:creator>SmartScanner</dc:creator>
      <pubDate>Sun, 18 Sep 2022 09:24:25 +0000</pubDate>
      <link>https://forem.com/smartscanner/update-cheat-sheet-for-developers-4gmc</link>
      <guid>https://forem.com/smartscanner/update-cheat-sheet-for-developers-4gmc</guid>
      <description>&lt;p&gt;This is a cheat sheet for updating critical web software.&lt;/p&gt;

&lt;p&gt;Using an outdated application is a high-risk vulnerability that has an easy fix. This guide provides easy-to-follow instructions for different applications to fix security vulnerabilities.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;⚠️ The goal of this guide is to eliminate vulnerabilities by updating applications. Sometimes updates can break things or lead to unexpected behaviors. It is up to you to perform enough checking and testing before using commands in this cheat sheet in the production environment.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  RHEL/CentOS/Oracle Linux
&lt;/h2&gt;

&lt;p&gt;Run below command in terminal (ssh)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo yum update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Debian/Ubuntu Linux
&lt;/h2&gt;

&lt;p&gt;Run below command in terminal (ssh)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt update &amp;amp;&amp;amp; sudo apt upgrade
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  OpenSUSE/SUSE Linux
&lt;/h2&gt;

&lt;p&gt;Run below command in terminal (ssh)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo zypper up
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  NodeJs (npm)
&lt;/h2&gt;

&lt;p&gt;Run the below command in your NodeJs project directory.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm audit fix
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note that some vulnerabilities cannot be fixed automatically and will require manual intervention or review.&lt;br&gt;
Some fixes can be forced using the below command but please make sure it doesn't break anything in your project.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm audit fix --force
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Python (pip)
&lt;/h2&gt;

&lt;p&gt;You have to update packages one by one. Run the below command to get a list of outdated packages.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip list --outdated
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For each package run the below command to update it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install [package_name] --upgrade
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  NuGet
&lt;/h2&gt;

&lt;p&gt;From the command line, you can update packages in the solution to the latest version available from nuget.org.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nuget update YourSolution.sln
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note that this will not run any PowerShell scripts in any NuGet packages.&lt;/p&gt;

&lt;p&gt;From within Visual Studio, you can use the &lt;a href="http://docs.nuget.org/docs/reference/package-manager-console-powershell-reference"&gt;Package Manager Console&lt;/a&gt; to also update the packages. This has the benefit that any PowerShell scripts will be run as part of the update whereas using NuGet.exe will not run them. The following command will update all packages in every project to the latest version available from nuget.org.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Update-Package
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  PHP (Composer)
&lt;/h2&gt;

&lt;p&gt;Navigate to the root of your application, where your &lt;code&gt;composer.json&lt;/code&gt; file is, and run the below command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php composer.phar update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In Windows:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;composer update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Go (golang)
&lt;/h2&gt;

&lt;p&gt;To update all packages in your &lt;code&gt;GOPATH&lt;/code&gt;, run the below command.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;go get -u all
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Ruby (gem)
&lt;/h2&gt;

&lt;p&gt;To update all gems:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gem update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;RubyGems keeps old versions of gems. Run cleanup to remove old gems after an update.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;gem cleanup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Maven (mvn)
&lt;/h2&gt;

&lt;p&gt;Run the below command to force an update of dependencies.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mvn clean install -U
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Rust (cargo)
&lt;/h2&gt;

&lt;p&gt;For updating all dependencies of your Rust project, you need to install a third-party crate. Install &lt;code&gt;cargo-update&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cargo install cargo-update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then run the below command to check for newer versions and update all installed packages.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cargo install-update -a
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  WordPress
&lt;/h2&gt;

&lt;p&gt;WordPress lets you update with the click of a button.  You can launch the update by clicking the link in the new version banner (if it’s there) or by going to the Dashboard &amp;gt; Updates screen. Once you are on the &lt;em&gt;“Update WordPress”&lt;/em&gt; page, click the button &lt;em&gt;“Update Now”&lt;/em&gt; to start the process off. You shouldn’t need to do anything else and, once it’s finished, you will be up-to-date.&lt;/p&gt;

&lt;h2&gt;
  
  
  Windows
&lt;/h2&gt;

&lt;p&gt;Run the below command on &lt;code&gt;cmd&lt;/code&gt; to open the Windows update screen.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;control update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can use &lt;a href="https://www.thesmartscanner.com/"&gt;SmartScanner for finding outdated components&lt;/a&gt; in your application.&lt;/p&gt;

&lt;h2&gt;
  
  
  References
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.npmjs.com/cli/v8/commands/npm-audit"&gt;npm-audit&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://wordpress.org/support/article/updating-wordpress/"&gt;Updating WordPress&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://stackoverflow.com/a/6882750"&gt;stackoverflow.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://stackoverflow.com/a/10383783"&gt;stackoverflow.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://stackoverflow.com/a/40982333"&gt;stackoverflow.com&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>node</category>
      <category>python</category>
      <category>ruby</category>
      <category>security</category>
    </item>
    <item>
      <title>CSRF, XXE, and 12 Other Security Acronyms Explained</title>
      <dc:creator>SmartScanner</dc:creator>
      <pubDate>Tue, 12 Jul 2022 08:59:30 +0000</pubDate>
      <link>https://forem.com/smartscanner/csrf-xxe-and-12-other-security-acronyms-explained-2ma7</link>
      <guid>https://forem.com/smartscanner/csrf-xxe-and-12-other-security-acronyms-explained-2ma7</guid>
      <description>&lt;p&gt;Acronyms are shortcuts, and we love using them, specially the catchy ones! Let's decipher some commonly used acronyms in the cyber security industry.&lt;/p&gt;

&lt;h2&gt;
  
  
  OWASP
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;Open Web Application Security Project (OWASP)&lt;/strong&gt; is a nonprofit foundation that works to improve the security of software. The OWASP Top 10 is one their popular projects.&lt;/p&gt;

&lt;h2&gt;
  
  
  XSS
&lt;/h2&gt;

&lt;p&gt;It stands for &lt;strong&gt;Cross-Site Scripting&lt;/strong&gt;. An X is used instead of the C to prevent confusion with Cascading Style Sheets (CSS).&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://www.thesmartscanner.com/vulnerability-list/cross-site-scripting"&gt;Read more about Cross-Site Scripting vulnerability&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  SQLI
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;SQL Injection&lt;/strong&gt;, is an attack where the SQL commands used in an application are manipulated by attacker. SQLI is a dangerous and common vulnerability. &lt;a href="https://www.thesmartscanner.com/"&gt;Find SQL Injection on your website&lt;/a&gt; with SmartScanner now.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://www.thesmartscanner.com/vulnerability-list/sql-injection"&gt;Read more about SQL Injection vulnerability&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  RCE
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Remote Command Execution&lt;/strong&gt; (RCE) is a high-risk vulnerability. It can occur anywhere from routers to online shops. By exploiting RCE, an attacker can execute commands (usually OS commands) on the target system.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://www.thesmartscanner.com/vulnerability-list/os-command-execution"&gt;Read more about Remote Command Execution vulnerability&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  DoS and DDos
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Denial of Service&lt;/strong&gt; (DoS) is a famous security acronym. You might have heard it at the news. DoS is a type of attack that makes the target service unavailable. Attackers usually perform DoS attacks by sending enormous traffic to the target.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Distributed Denial of Service&lt;/strong&gt; (DDoS) is a DoS attack from many different sources. This type of DoS typically runs using zombie botnets.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--trqy02sn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w89u2gqufmshslslzcpa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--trqy02sn--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w89u2gqufmshslslzcpa.png" alt="Results of a Denial of Service Attack" width="648" height="361"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  CSRF
&lt;/h2&gt;

&lt;p&gt;CSRF (pronounce Sea Surf) stands for &lt;strong&gt;Cross-Site Request Forgery&lt;/strong&gt;. CSRF (aka XSRF) is an attack where the attacker sends a request on behalf of a victim user without her knowledge. Attackers exploit CSRF to do actions using the victim's permission. For example, a hacker can create an admin user for himself using a CSRF attack.&lt;/p&gt;

&lt;h2&gt;
  
  
  XXE
&lt;/h2&gt;

&lt;p&gt;An &lt;strong&gt;XML External Entity&lt;/strong&gt; attack is a kind of attack against an application that parses XML input. In this attack, the vulnerable application processes a reference to an external entity in the provided XML. The XXE is a dangerous attack that can lead to information disclosure or denial of service attacks.&lt;/p&gt;

&lt;h2&gt;
  
  
  SSRF
&lt;/h2&gt;

&lt;p&gt;In a &lt;strong&gt;Server-Side Request Forgery&lt;/strong&gt; (SSRF) attack, the attacker can abuse functionality on the server to read or update internal resources.&lt;/p&gt;

&lt;h2&gt;
  
  
  SSI
&lt;/h2&gt;

&lt;p&gt;A &lt;strong&gt;Server-Side Includes Injection&lt;/strong&gt; is a type of security attack that exploits the Service-side Includes features of a web server. The &lt;em&gt;Server-side includes&lt;/em&gt; are tags in HTML files. The web server executes these tags to add dynamic contents to the page before sending it to the user.&lt;/p&gt;

&lt;h2&gt;
  
  
  RFI
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Remote File Inclusion&lt;/strong&gt; (RFI) occurs when the web application downloads and executes a remote file. This remote file is usually controlled by an attacker and is passed as a request parameter.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://www.thesmartscanner.com/vulnerability-list/remote-file-inclusion"&gt;Read more about Remote File Inclusion vulnerability&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  LFI / LFD
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Local File Inclusion&lt;/strong&gt; (LFI) is similar to a remote file inclusion vulnerability, but only local files on the server can be included for execution. It does not mean the LFI is less dangerous than RFI.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--pqzJtzzw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4olhd1kuxkzd3ufkrupr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--pqzJtzzw--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4olhd1kuxkzd3ufkrupr.png" alt="Local File Inclusion and Path Traversal Payload Variations" width="640" height="362"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;When the local file is only opened and sent back to the user (or attacker), it is called &lt;strong&gt;Local File Download&lt;/strong&gt; or &lt;strong&gt;Disclosure&lt;/strong&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;a href="https://www.thesmartscanner.com/vulnerability-list/local-file-inclusion"&gt;Read more about Local File Inclusion&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  IDOR
&lt;/h2&gt;

&lt;p&gt;IDOR stands for &lt;strong&gt;Insecure Direct Object Reference&lt;/strong&gt;. It is a vulnerability that occurs when a reference to an internal object, such as a file or directory, is retrieved from user-supplied input. If no proper authorization is implemented, an attacker can abuse this reference to access every object.&lt;/p&gt;

&lt;h2&gt;
  
  
  CVE
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;Common Vulnerabilities and Exposures&lt;/strong&gt; (CVE) system provides a mechanism for referencing publicly known security vulnerabilities.&lt;/p&gt;

&lt;h2&gt;
  
  
  CWE
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;Common Weakness Enumeration&lt;/strong&gt; (CWE) is a category system for hardware and software weaknesses and vulnerabilities.&lt;/p&gt;

</description>
      <category>security</category>
      <category>webdev</category>
      <category>programming</category>
      <category>devops</category>
    </item>
    <item>
      <title>10 Secure Coding Best Practices to Follow in Every Project</title>
      <dc:creator>SmartScanner</dc:creator>
      <pubDate>Sat, 11 Jun 2022 09:57:01 +0000</pubDate>
      <link>https://forem.com/smartscanner/10-secure-coding-best-practices-to-follow-in-every-project-1i9h</link>
      <guid>https://forem.com/smartscanner/10-secure-coding-best-practices-to-follow-in-every-project-1i9h</guid>
      <description>&lt;p&gt;Let's see how we can make more secure software.&lt;/p&gt;

&lt;h2&gt;
  
  
  Update, Update, Update!
&lt;/h2&gt;

&lt;p&gt;Using vulnerable and outdated components with known vulnerabilities has always been in the &lt;a href="https://owasp.org/www-project-top-ten/"&gt;OWASP Top 10 Application Security Risks&lt;/a&gt;. You can take a giant leap in securing your projects only if you use up-to-date tools and libraries.&lt;/p&gt;

&lt;h2&gt;
  
  
  Stick to Standards
&lt;/h2&gt;

&lt;p&gt;If you have the &lt;a href="https://en.wikipedia.org/wiki/Not_invented_here"&gt;&lt;em&gt;Not invented here (NIH)&lt;/em&gt;&lt;/a&gt; syndrome, you prefer to develop everything from scratch. That's fine if you have the time and money to do so. But building major things like cryptography and web servers from scratch needs a lot of skills and effort. Such complex components cannot be built by a single person. Even if you have made one, you should not use it in production without in-depth reviews from many other people.&lt;/p&gt;

&lt;p&gt;In design and architecture concepts, you should do the same. You should follow best practices to benefit from the community experience.&lt;/p&gt;

&lt;p&gt;Next time instead of introducing your own hash algorithm, use one of the &lt;a href="https://en.wikipedia.org/wiki/Cryptographic_hash_function#Cryptographic_hash_algorithms"&gt;well-known hash functions&lt;/a&gt; implemented by an open-source and peer-reviewed library.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use Trustworthy Packages
&lt;/h2&gt;

&lt;p&gt;One significant risk of using third-party modules (like packages in npm, PyPI, NuGet, etc. ) is the &lt;em&gt;Supply Chain Attack&lt;/em&gt;. Consider one of your project's dependencies goes rogue and doesn't do what it was supposed to do. It is called a supply chain attack. This has happened for popular npm packages (UA-Parser-JS, COA, and RC), and it can happen for many others.&lt;/p&gt;

&lt;p&gt;We know that using third-party packages is inevitable. So, here are a few tips to consider before choosing a third-party library.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Prefer packages with more contributions (more contributors, commits, pull requests, and stars)&lt;/li&gt;
&lt;li&gt;Prefer packages with less open issues&lt;/li&gt;
&lt;li&gt;Prefer packages with higher release frequency&lt;/li&gt;
&lt;li&gt;Use dependency scanners like &lt;a href="https://docs.github.com/en/code-security/dependabot/dependabot-security-updates/configuring-dependabot-security-updates"&gt;GitHub Dependabot&lt;/a&gt; to find vulnerable packages.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Never Trust User
&lt;/h2&gt;

&lt;p&gt;Always validate data received from user input before processing them. Check the length, type, allowed characters, and data pattern before using it.&lt;/p&gt;

&lt;p&gt;The essential thing in user validation is to do it where the user cannot manipulate the logic. For example, the user has complete control over a webpage, so checking if the user entered a correct email address on the client is not enough, and you should validate it on the back-end again.&lt;/p&gt;

&lt;h2&gt;
  
  
  Always Encode Output
&lt;/h2&gt;

&lt;p&gt;Always use proper encoding when displaying data to the user. The encoding depends on the context you display the data within.&lt;br&gt;
For example, data on a web page should be HTML-Encoded, and data in URL should be URL-Encoded. Other contexts like CSV, XML, JSON files, or email need unique encodings.&lt;/p&gt;

&lt;h2&gt;
  
  
  Catch Exceptions
&lt;/h2&gt;

&lt;p&gt;Exceptions happen! We should be prepared for them. Unhandled errors create security issues like failing insecurely or &lt;a href="https://www.thesmartscanner.com/vulnerability-list/detailed-application-and-database-error"&gt;revealing sensitive information&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Always assume things will break eventually and get prepared for it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Do not Write Secrets in Comments
&lt;/h2&gt;

&lt;p&gt;When you put comments in the code, it means your code is not clear and expressive enough and needs explanation. So, a better title for this section would be &lt;em&gt;Do not Write Comments&lt;/em&gt;.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;“Comments are always failures.”&lt;/em&gt;&lt;br&gt;
— Robert C. Martin @ Clean Code&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;There are some valid use-cases for comments in the code, but writing operational information and sensitive data like passwords are not one of them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Use Linter
&lt;/h2&gt;

&lt;p&gt;Linters can analyze your code and enforce particular rules. Linters assist you in finding errors, bugs, code smells, and suspicious expressions like using &lt;code&gt;eval&lt;/code&gt; and dangerous regular expressions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Possess an Open-Source Spirit
&lt;/h2&gt;

&lt;p&gt;Open source projects are maintained by the community. It means their structure is not specific to a single user's environment. Open source projects (usually) don't have any hard-coded passwords or internal IP addresses. These are good practices we can follow in our projects.&lt;/p&gt;

&lt;p&gt;Not every project is supposed to be open-source and publicly available. But we should prepare all projects for open sourcing. Here are a few things to start:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Remove hard-coded passwords, IP addresses, and database connection strings, ...&lt;/li&gt;
&lt;li&gt;Load all configurations from environment variables&lt;/li&gt;
&lt;li&gt;Add a &lt;code&gt;readme.md&lt;/code&gt; file to your project and document build and test instructions.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Write Clean Code
&lt;/h2&gt;

&lt;p&gt;A clean code is inherently more secure. From a security point of view, a clear code has many benefits:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A clear code has fewer opportunities for vulnerabilities to occur because they're less complex&lt;/li&gt;
&lt;li&gt;Reviewing and finding vulnerabilities in a clear code is easier&lt;/li&gt;
&lt;li&gt;It takes less time and effort to fix a vulnerability in a clear code&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;You can read the &lt;a href="https://www.google.com/books/edition/_/hjEFCAAAQBAJ"&gt;Clean Code&lt;/a&gt; book (if you haven't read it already) and start refactoring your codes.&lt;/p&gt;

</description>
      <category>programming</category>
      <category>opensource</category>
      <category>security</category>
      <category>architecture</category>
    </item>
    <item>
      <title>Serverless Application is not as secure as you might think!</title>
      <dc:creator>SmartScanner</dc:creator>
      <pubDate>Sat, 21 May 2022 11:08:54 +0000</pubDate>
      <link>https://forem.com/smartscanner/serverless-application-is-not-as-secure-as-you-might-think-4dpb</link>
      <guid>https://forem.com/smartscanner/serverless-application-is-not-as-secure-as-you-might-think-4dpb</guid>
      <description>&lt;h2&gt;
  
  
  What is a Serverless Application?
&lt;/h2&gt;

&lt;p&gt;For running a traditional web application, you need to set up an OS, configure a web server, install a CMS and prepare a database. You should take care of infrastructure, capacity, and maintenance of servers as long as your application is running.&lt;/p&gt;

&lt;p&gt;What if you could only focus on developing your application and don't think about the infrastructure? This is exactly what you can do in a Serverless architecture. You write your code and publish it on cloud servers like AWS Lambda, Cloudflare workers, or Google Cloud Functions. Your code will run on cloud servers, and your cloud provider manages and handles the infrastructure and maintenance.&lt;/p&gt;

&lt;p&gt;Cloud companies that provide Serverless services offer different form of it. Take FaaS as an example. In this development model, cloud providers allow you to write your application in small separate functions. That's why this service is called Function as a service (FaaS). This approach supports trending architectures like the JAMstack (JavaScript, API &amp;amp; Markup). The JAMStack consists of static pages (the Markup) that integrate with the backend through the use of APIs in Serverless applications.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 PaaS is also another Serverless cloud service where you control the entire application. This is in contrast with FaaS that has an event-driven architecture. In FaaS, your application (function) gets executed in certain events like incoming requests.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Serverless Security
&lt;/h2&gt;

&lt;p&gt;The Serverless development model has many benefits like cost efficiency, elasticity, and productivity. But Serverless applications are not more secure compared to traditional applications. Cloud providers like Amazon AWS take care of OS and platform vulnerabilities, but you don't have access to the servers, and you can't use classic security solutions like IDS/IPS that require installation on endpoints.&lt;/p&gt;

&lt;p&gt;Further, in a Serverless architecture, the entire application consists of more small components, that means more entry points resulting in an increased attack surface.&lt;/p&gt;

&lt;p&gt;Developing and running a Serverless application depends on the cloud provider's standards. This means the same code can not be used in another cloud provider without change.&lt;/p&gt;

&lt;p&gt;Privacy is another concern in Serverless applications because of using shared resources and access by external employees in public Serverless cloud infrastructure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Vulnerabilities in Serverless Applications
&lt;/h2&gt;

&lt;p&gt;Security vulnerabilities affect different layers of any application like OS, web server, database, and the application itself. In Serverless architectures, the cloud provider takes care of all infrastructure security. So you won't worry about security misconfigurations and issues like &lt;a href="https://www.thesmartscanner.com/vulnerability-list/vulnerable-apache-version"&gt;Outdated server vulnerability&lt;/a&gt;. But the application security is still your responsibility in the Serverless development model. And unfortunately, many vulnerabilities relate to the application layer. Vulnerabilities like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://www.thesmartscanner.com/vulnerability-list/sql-injection"&gt;SQL Injection&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.thesmartscanner.com/vulnerability-list/cross-site-scripting"&gt;Cross-Site Scripting (XSS)&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.thesmartscanner.com/vulnerability-list/local-file-inclusion"&gt;File Inclusion Vulnerabilities&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Cross-site Request Forgery (CSRF)&lt;/li&gt;
&lt;li&gt;Using &lt;code&gt;eval&lt;/code&gt; and Command Execution&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.thesmartscanner.com/vulnerability-list/unvalidated-redirection"&gt;Unvalidated Redirects and Forwards&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;These are generic vulnerabilities that are in OWASP's Top 10 list. We have covered some of them in articles like &lt;a href="https://www.thesmartscanner.com/blog/how-do-hackers-hack"&gt;common web vulnerabilities&lt;/a&gt; and &lt;a href="https://www.thesmartscanner.com/blog/how-to-secure-your-nodejs-express-javascript-application-part-1"&gt;securing your NodeJs express application&lt;/a&gt;. In the followings, we will review vulnerabilities that are less known but more specific to Serverless applications.&lt;/p&gt;

&lt;h3&gt;
  
  
  Missing Function Level Access Control
&lt;/h3&gt;

&lt;p&gt;Sensitive functionalities should be protected with an authentication mechanism. It doesn't matter whether these functionalities are served as web pages or an API. If anyone can access such functionalities, this is a broken access control flaw.&lt;/p&gt;

&lt;p&gt;All administration use-cases are prone to this issue. You might have several Serverless APIs for tasks like managing accounts/posts or changing service status. You should make sure that only allowed users can access and use such functionalities.&lt;/p&gt;

&lt;h3&gt;
  
  
  Sensitive Data Exposure
&lt;/h3&gt;

&lt;p&gt;Let's say you have a Serverless application for a voting system. One function of this platform is to show the vote counts for any candidate. Consider a Serverless function for displaying vote counts which accepts candidate ID and returns a list of every user who has voted for that candidate. So you can easily show the count of users as vote counts for the candidate.&lt;br&gt;
But something's fishy here! We need a function to display vote counts, not to return name of voters! You might say that the list of users is not displayed anywhere, and only the count of users is represented. That's right, but as long as the Serverless function is returning all those information and it's publicly accessible, an attacker can abuse it.&lt;/p&gt;

&lt;p&gt;Sensitive Data Exposure is a very common flaw. To avoid it you should return the minimum required data in your Serverless functions.&lt;/p&gt;

&lt;h3&gt;
  
  
  Insecure Direct Object Reference (IDOR)
&lt;/h3&gt;

&lt;p&gt;Imagine an HR application that has a profile API that accepts an employee ID and returns the employee information. Let's say the employee IDs are an integer number and the Serverless function queries it on the database to find the employee. What could go wrong in this scenario? An attacker can build a collection of employee IDs by starting from 1 and incrementing to any number. Then this collection can be used to query your function to enumerate all employee information. This can happen if the API does not implement the proper access control we discussed earlier.&lt;/p&gt;

&lt;p&gt;Here employee ID passed to the Serverless API is a reference to the employee record in the database. And this reference is directly controlled by the user. If such references are easy to guess, you risk your data being enumerated.&lt;/p&gt;

&lt;p&gt;Avoid using guessable patterns for IDs (using hash can help). Make sure your functions have access control to mitigate IDOR flaws.&lt;/p&gt;

&lt;h3&gt;
  
  
  Template Language Injection
&lt;/h3&gt;

&lt;p&gt;A common way of rendering HTML pages using a template is to evaluate an expression like &lt;code&gt;2+2&lt;/code&gt; and display the results (&lt;code&gt;4&lt;/code&gt;) in output. &lt;a href="https://www.thesmartscanner.com/vulnerability-list/expression-language-injection"&gt;Template language injection&lt;/a&gt; or Expression language injection occurs when a user can change the expression used in the template.&lt;/p&gt;

&lt;h3&gt;
  
  
  Components with Known Vulnerabilities
&lt;/h3&gt;

&lt;p&gt;Serverless applications are usually in JavaScript (or TypeScript) or Python languages. Developers in Python or JavaScript usually use numerous third-party packages for completing different tasks. These packages might have vulnerabilities, and using them can make your Serverless application vulnerable.&lt;/p&gt;

&lt;p&gt;To mitigate component vulnerabilities, make sure you're using the updated version of any library and run security tests to find vulnerable packages.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 In NodeJs, you can use &lt;code&gt;npm audit&lt;/code&gt; to find vulnerabilities in npm packages. Read &lt;a href="https://www.thesmartscanner.com/blog/how-to-secure-your-nodejs-express-javascript-application-part-1"&gt;Securing Your NodeJs JavaScript Project&lt;/a&gt; for details.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;Serverless applications have many benefits and use cases like file transformation, providing dynamic contents, logging, and others. There's a misunderstanding that Serverless applications are more secure. This is true to some extent when it comes to OS vulnerabilities, but you need to take application layer security in your hand.&lt;/p&gt;

&lt;p&gt;We reviewed some of the common vulnerabilities in Serverless applications, but you should know that these vulnerabilities are not complete and these are not even limited to Serverless applications. So security testing of your web applications is a crucial job for securing them.&lt;br&gt;
Security of Serverless applications needs a DevSecOps solution where developers, operation team, and Security guys collaborate closely.&lt;/p&gt;

</description>
      <category>serverless</category>
      <category>javascript</category>
      <category>cloud</category>
      <category>security</category>
    </item>
  </channel>
</rss>
