Recent change of S2245 and similar

While comparing the following version I faced an issue with S2245.

Edition Old version New version
Community Edition v26.2.0.119303 v26.9.0.129388
Developer Edition v2026.1 v2026.4.1

The “Old version” is used in our production system, the “New version” is active in our testing system.

I found in the github repo sonar-dotnet that this (and other) issue(s) has been “moved out of hostspot”. Ok, you have deprecated “security hotspots”. So far I did not find more detailed information about that change. Is there any detailed information?

Further I noticed that the rule is now “customized from Major to Critical”. I think, this is reported as changed because you internally changed the severity while it is still configured in the old one.

  1. Why this is not adopted automatically?
  2. How to identify all rules which are not configured to the recommended severity?

Hey @lg2de,

Yes, as you have found out, security hotspots are being deprecated in favor of vulnerabilities, and are being migrated. There is indeed detailed information about this, you can read more about it in the Community announcement.

Could you elaborate a bit more on this “customized from Major to Critical”? Do you have a screenshot of where do you see this?

Here is a screenshot of the outcome:

@lg2de, okay, I see. If you go to this quality profile > See Changelog, can you spot the entry in which this rule’s severity has been changed? The Changelog is useful when trying to spot if a change has been made by a user or automatically (by the “system” user).

No, there is no change on “Pseudorandom number generators…” in the changelog!

Hey @lg2de, before escalating this, I want to be extra sure that there’s no entry in the changelog. Could you please check the DB directly:

SELECT
  to_timestamp(qpc.created_at / 1000.0) AS changed_at,
  qpc.change_type,
  qpc.change_data,
  u.login AS username,
  qpc.sq_version,
  qpc.kee AS change_uuid
FROM qprofile_changes qpc
JOIN rules_profiles qp
  ON qp.uuid = qpc.rules_profile_uuid
JOIN rules r
  ON qpc.change_data LIKE '%ruleUuid=' || r.uuid || '%'
LEFT JOIN users u
  ON u.uuid = qpc.user_uuid
WHERE qp.name = 'Advanced'
  AND r.plugin_rule_key = 'S2245'
ORDER BY qpc.created_at DESC;

Here is the result:

501:root@vm1695:~# docker exec -it sonarqube-ce-db-1 psql -U sonar -d sonar
WARNING:  database "sonar" has a collation version mismatch
DETAIL:  The database was created using collation version 2.36, but the operating system provides version 2.41.
HINT:  Rebuild all objects in this database that use the default collation and run ALTER DATABASE sonar REFRESH COLLATION VERSION, or build PostgreSQL with the right library version.
psql (15.19 (Debian 15.19-1.pgdg13+2))
Type "help" for help.

sonar=# SELECT
  to_timestamp(qpc.created_at / 1000.0) AS changed_at,
  qpc.change_type,
  qpc.change_data,
  u.login AS username,
  qpc.sq_version,
  qpc.kee AS change_uuid
FROM qprofile_changes qpc
JOIN rules_profiles qp
  ON qp.uuid = qpc.rules_profile_uuid
JOIN rules r
  ON qpc.change_data LIKE '%ruleUuid=' || r.uuid || '%'
LEFT JOIN users u
  ON u.uuid = qpc.user_uuid
WHERE qp.name = 'Advanced'
  AND r.plugin_rule_key = 'S2245'
ORDER BY qpc.created_at DESC;
 changed_at | change_type | change_data | username | sq_version | change_uuid
------------+-------------+-------------+----------+------------+-------------
(0 rows)

sonar=# exit
502:root@vm1695:~# docker exec -it sonarqube-de-db-1 psql -U sonar -d sonar
WARNING:  database "sonar" has a collation version mismatch
DETAIL:  The database was created using collation version 2.36, but the operating system provides version 2.41.
HINT:  Rebuild all objects in this database that use the default collation and run ALTER DATABASE sonar REFRESH COLLATION VERSION, or build PostgreSQL with the right library version.
psql (15.19 (Debian 15.19-1.pgdg13+2))
Type "help" for help.

sonar=# SELECT
  to_timestamp(qpc.created_at / 1000.0) AS changed_at,
  qpc.change_type,
  qpc.change_data,
  u.login AS username,
  qpc.sq_version,
  qpc.kee AS change_uuid
FROM qprofile_changes qpc
JOIN rules_profiles qp
  ON qp.uuid = qpc.rules_profile_uuid
JOIN rules r
  ON qpc.change_data LIKE '%ruleUuid=' || r.uuid || '%'
LEFT JOIN users u
  ON u.uuid = qpc.user_uuid
WHERE qp.name = 'Advanced'
  AND r.plugin_rule_key = 'S2245'
ORDER BY qpc.created_at DESC;
 changed_at | change_type | change_data | username | sq_version | change_uuid
------------+-------------+-------------+----------+------------+-------------
(0 rows)

sonar=#

Hey @lg2de, sorry, I’m realizing just now that your quality profile name is not “Advanced”, but “___ Advanced” (you redacted the prefix in the screenshot). The query hardcodes “Advanced” as quality profile name. Could you please try it again with the real name of the quality profile? Feel free to also redact your response with these results.

I would also like to confirm: are you seeing this situation in both the Community and the Developer edition? Or only on one?

Thanks for your patience, I’m just trying to clear any doubts before sending this to the devs.

New result Community Edition:

         changed_at         | change_type |                      change_data                      |   username   | sq_version |     change_uuid
----------------------------+-------------+-------------------------------------------------------+--------------+------------+----------------------
 2021-12-06 14:56:21.481+00 | UPDATED     | severity=MAJOR;ruleUuid=6052;inheritance=INHERITED    | gruetzmacher |            | AX2QPufpsnFp4edg8q_W
 2021-12-06 14:56:21.48+00  | UPDATED     | severity=CRITICAL;ruleUuid=6051;inheritance=INHERITED | gruetzmacher |            | AX2QPufosnFp4edg8q_T
 2021-12-06 14:54:59.847+00 | ACTIVATED   | severity=MAJOR;ruleUuid=6053                          | gruetzmacher |            | AX2QPakHsnFp4edg8oIg
 2021-12-06 14:54:59.846+00 | ACTIVATED   | severity=MAJOR;ruleUuid=6058                          | gruetzmacher |            | AX2QPakGsnFp4edg8oIc
 2021-12-06 14:54:59.838+00 | ACTIVATED   | severity=MAJOR;ruleUuid=6055                          | gruetzmacher |            | AX2QPaj-snFp4edg8oHs
 2021-12-06 14:54:59.836+00 | ACTIVATED   | severity=MAJOR;ruleUuid=6054                          | gruetzmacher |            | AX2QPaj8snFp4edg8oHg
 2021-12-06 14:54:59.835+00 | ACTIVATED   | severity=MAJOR;ruleUuid=6050                          | gruetzmacher |            | AX2QPaj7snFp4edg8oHe
 2021-12-06 14:54:59.727+00 | ACTIVATED   | severity=MAJOR;ruleUuid=6057                          | gruetzmacher |            | AX2QPaiPsnFp4edg8n9S
 2021-12-06 14:54:59.689+00 | ACTIVATED   | severity=MAJOR;ruleUuid=6059                          | gruetzmacher |            | AX2QPahpsnFp4edg8n5m
 2021-12-06 14:54:59.624+00 | ACTIVATED   | severity=MAJOR;ruleUuid=6052                          | gruetzmacher |            | AX2QPagosnFp4edg8ny0
 2021-12-06 14:54:59.62+00  | ACTIVATED   | severity=CRITICAL;ruleUuid=6051                       | gruetzmacher |            | AX2QPagksnFp4edg8nye
 2021-12-06 14:54:59.618+00 | ACTIVATED   | severity=MAJOR;ruleUuid=6056                          | gruetzmacher |            | AX2QPagisnFp4edg8nyQ
 2021-12-06 14:45:56.941+00 | ACTIVATED   | severity=CRITICAL;ruleUuid=5466                       | gruetzmacher |            | AX2QNWBNsnFp4edg8h0R
(13 rows)

Results Developer Edition:

         changed_at         | change_type |                              change_data                              |   username   |   sq_version    |             change_uuid
----------------------------+-------------+-----------------------------------------------------------------------+--------------+-----------------+--------------------------------------
 2026-05-13 10:59:37.487+00 | ACTIVATED   | severity=CRITICAL;prioritizedRule=false;ruleUuid=AYuoyeQPL_GY0GevhV5g | gruetzmacher | 2026.2.1.121354 | 6698af08-aaf2-49fb-a9bc-23e0d9371477
 2026-04-07 14:56:18.911+00 | ACTIVATED   | severity=MAJOR;prioritizedRule=false;ruleUuid=AYuoyeBiL_GY0GevhTN1    | gruetzmacher | 2026.2.1.121354 | af026435-3908-4ade-87f4-0301cb4ff7a7
 2026-04-07 14:56:18.901+00 | ACTIVATED   | severity=CRITICAL;prioritizedRule=false;ruleUuid=AYuoyeBiL_GY0GevhTN_ | gruetzmacher | 2026.2.1.121354 | c6923217-2067-4bab-b429-110f389c1d1d
 2026-04-07 14:55:05.387+00 | ACTIVATED   | severity=BLOCKER;prioritizedRule=false;ruleUuid=AYuoyeBiL_GY0GevhTN6  | gruetzmacher | 2026.2.1.121354 | ee30b3d7-c8cc-4ad3-8b9d-ccdc7361eb7f
 2026-04-07 14:54:54.069+00 | ACTIVATED   | severity=CRITICAL;prioritizedRule=false;ruleUuid=AYuoyeBiL_GY0GevhTNv | gruetzmacher | 2026.2.1.121354 | cf813245-5094-4e6b-bcdc-4289939bac3b
 2021-12-06 14:56:21.481+00 | UPDATED     | severity=MAJOR;ruleUuid=6052;inheritance=INHERITED                    | gruetzmacher |                 | AX2QPufpsnFp4edg8q_W
 2021-12-06 14:56:21.48+00  | UPDATED     | severity=CRITICAL;ruleUuid=6051;inheritance=INHERITED                 | gruetzmacher |                 | AX2QPufosnFp4edg8q_T
 2021-12-06 14:54:59.847+00 | ACTIVATED   | severity=MAJOR;ruleUuid=6053                                          | gruetzmacher |                 | AX2QPakHsnFp4edg8oIg
 2021-12-06 14:54:59.846+00 | ACTIVATED   | severity=MAJOR;ruleUuid=6058                                          | gruetzmacher |                 | AX2QPakGsnFp4edg8oIc
 2021-12-06 14:54:59.838+00 | ACTIVATED   | severity=MAJOR;ruleUuid=6055                                          | gruetzmacher |                 | AX2QPaj-snFp4edg8oHs
 2021-12-06 14:54:59.836+00 | ACTIVATED   | severity=MAJOR;ruleUuid=6054                                          | gruetzmacher |                 | AX2QPaj8snFp4edg8oHg
 2021-12-06 14:54:59.835+00 | ACTIVATED   | severity=MAJOR;ruleUuid=6050                                          | gruetzmacher |                 | AX2QPaj7snFp4edg8oHe
 2021-12-06 14:54:59.727+00 | ACTIVATED   | severity=MAJOR;ruleUuid=6057                                          | gruetzmacher |                 | AX2QPaiPsnFp4edg8n9S
 2021-12-06 14:54:59.689+00 | ACTIVATED   | severity=MAJOR;ruleUuid=6059                                          | gruetzmacher |                 | AX2QPahpsnFp4edg8n5m
 2021-12-06 14:54:59.624+00 | ACTIVATED   | severity=MAJOR;ruleUuid=6052                                          | gruetzmacher |                 | AX2QPagosnFp4edg8ny0
 2021-12-06 14:54:59.62+00  | ACTIVATED   | severity=CRITICAL;ruleUuid=6051                                       | gruetzmacher |                 | AX2QPagksnFp4edg8nye
 2021-12-06 14:54:59.618+00 | ACTIVATED   | severity=MAJOR;ruleUuid=6056                                          | gruetzmacher |                 | AX2QPagisnFp4edg8nyQ
 2021-12-06 14:45:56.941+00 | ACTIVATED   | severity=CRITICAL;ruleUuid=5466                                       | gruetzmacher |                 | AX2QNWBNsnFp4edg8h0R

Even this shows several changes by myself I cannot remember to did this explicitely.