diff --git a/css-sonarpedia/sonarpedia.json b/css-sonarpedia/sonarpedia.json index 81d177147a3..894191d0bf8 100644 --- a/css-sonarpedia/sonarpedia.json +++ b/css-sonarpedia/sonarpedia.json @@ -3,7 +3,7 @@ "languages": [ "CSS" ], - "latest-update": "2023-08-22T10:03:45.701595900Z", + "latest-update": "2023-09-01T11:54:21.651165Z", "options": { "no-language-in-filenames": true } diff --git a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S2699.html b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S2699.html index 0e62341e190..150b0de42f4 100644 --- a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S2699.html +++ b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S2699.html @@ -8,7 +8,7 @@

Why is this an issue?

Without assertions, a unit test doesn’t actually verify anything, making it ineffective in catching potential bugs or regressions. It will always pass, regardless of the implementation of the unit. This can lead to a false sense of security, as you may believe that your code is working correctly when it might not be.

-

This rule raises an issue when the assertion library chai is imported but no assertion is used in a test.

+

This rule raises an issue when the assertion library chai or sinon is imported but no assertion is used in a test.

 const expect = require("chai").expect;
 
@@ -34,5 +34,6 @@ 

Resources

Documentation

diff --git a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S5689.html b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S5689.html index 179252fa8c7..e7795762869 100644 --- a/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S5689.html +++ b/sonar-plugin/javascript-checks/src/main/resources/org/sonar/l10n/javascript/rules/javascript/S5689.html @@ -1,36 +1,50 @@ -

Disclosing technology fingerprints allows an attacker to gather information about the technologies used to develop the web application and to -perform relevant security assessments more quickly (like the identification of known vulnerable components).

+

Disclosure of version information, usually overlooked by developers but disclosed by default by the systems and frameworks in use, can pose a +significant security risk depending on the production environement.

+

Once this information is public, attackers can use it to identify potential security holes or vulnerabilities specific to that version.

+

Furthermore, if the published version information indicates the use of outdated or unsupported software, it becomes easier for attackers to exploit +known vulnerabilities. They can search for published vulnerabilities related to that version and launch attacks that specifically target those +vulnerabilities.

Ask Yourself Whether

There is a risk if you answered yes to any of these questions.

Recommended Secure Coding Practices

-

It’s recommended to not disclose technologies used on a website, with x-powered-by HTTP header for example.

-

In addition, it’s better to completely disable this HTTP header rather than setting it a random value.

+

In general, it is recommended to keep internal technical information within internal systems to control what attackers know about the underlying +architectures. This is known as the "need to know" principle.

+

The most effective solution is to remove version information disclosure from what end users can see, such as the "x-powered-by" header.
This +can be achieved directly through the web application code, server (nginx, apache) or firewalls.

+

Disabling the server signature provides additional protection by reducing the amount of information available to attackers. Note, however, that +this does not provide as much protection as regular updates and patches.
Security by obscurity is the least foolproof solution of all. It should +never be the only defense mechanism and should always be combined with other security measures.

Sensitive Code Example

-

Express.js name is disclosed by default into the x-powered-by HTTP header:

+

In Express.js, version information is disclosed by default in the x-powered-by +HTTP header:

 let express = require('express');
-let app = express(); // Sensitive
 
-app.get('/', function (req, res) {
-  res.send('hello')
+let example = express(); // Sensitive
+
+example.get('/', function (req, res) {
+  res.send('example')
 });
 

Compliant Solution

x-powered-by HTTP header should be disabled in Express.js with -app.disable or with helmet hidePoweredBy middleware:

+app.disable:

 let express = require('express');
 
-let app1 = express();  // Compliant
-app1.disable("x-powered-by");
-
+let example = express();
+example.disable("x-powered-by");
+
+

Or with helmet’s hidePoweredBy middleware:

+
 let helmet = require("helmet");
-let app2 = express(); // Compliant
-app2.use(helmet.hidePoweredBy());
+
+let example = express();
+example.use(helmet.hidePoweredBy());
 

See