Chapter 15Lesson 01~120 minutes

Security Hotspots, Vulnerabilities, Taint Analysis, and Review Workflow: Core Concepts and Mental Model

Separate security findings by meaning and evidence: vulnerabilities/security issues require remediation, hotspot-style findings require contextual review, and advanced taint analysis is edition/language dependent.

SecurityVulnerabilitiesHotspot reviewTaint analysisGovernance

Learning objectives

  • Distinguish a vulnerability/security issue from a hotspot-style review finding and from an advanced taint/data-flow finding.
  • Trace source revision → active security rule/analyzer → finding → review/fix → reanalysis → rating/gate/audit evidence.
  • Explain why finding category, analyzer capability, instance mode, edition, and language support must be recorded before interpretation.
  • Explain the 2026 Security Hotspot migration and why old Hotspots UI/API assumptions must not be hard-coded into automation.
  • Interpret security ratings and review evidence without claiming that a clean scan proves an application secure.
  • Keep scanner success, Compute Engine success, security finding state, gate state, and review disposition as separate facts.

1. The practical problem: “security finding” is not one workflow

Chapter 14 taught that SonarQube consumes evidence rather than magically discovering every external fact. Chapter 15 adds a second distinction: not every security-related result means the same thing or asks the team to perform the same action.

A vulnerability (called a Security Vulnerability in Standard Experience and a Security impact in MQR-oriented terminology) is a finding that indicates code requiring remediation. A classic Security Hotspot historically meant security-sensitive code that required human context before deciding whether it was safe or needed a fix. Advanced taint analysis adds another dimension: it reasons about data flowing from a source through transformations to a dangerous sink, and current Sonar product packaging makes this capability language- and edition-dependent.

revision + active security rules + analyzer capability → security finding → classify meaning → fix or justified review → reanalysis → issue/review history → security rating / gate / residual-risk note

2. Current 2026 reality: Security Hotspots are being migrated

Version-sensitive workflow. Sonar announced in 2026 that Security Hotspots are being phased out and rewritten as ordinary security issues/vulnerabilities. The legacy api/hotspots family is deprecated from the 2026.4 server line. On Community Build 26.9, a rule that older material calls a “hotspot rule” may already surface as a normal security issue instead of a separate Hotspot object.

For that reason, this course uses hotspot-style finding as the durable concept: a rule that historically asked for contextual review rather than immediate remediation. When your current instance still exposes a classic hotspot, preserve its review status/history. When the rule has already migrated, use the current issue workflow and record the rule key, issue type/impact, migration tag or history, and the contextual review rationale.

Concept Older/classic representation Current-safe interpretation
Vulnerability Security Vulnerability issue Security issue that requires remediation; terminology depends on instance mode.
Hotspot-style rule Separate Security Hotspot object and review workflow May still be a hotspot or may have migrated to an ordinary security issue; inspect the current object rather than assuming.
Taint finding Injection vulnerability with flow Advanced source-to-sink analysis; verify language and commercial-edition availability.

3. Mental model: finding type determines the next evidence

Security analysis causality
flowchart TD
  A[Local source revision] --> B[Security rules / analyzers]
  B --> C{Finding kind}
  C -->|Security issue / vulnerability| D[Remediate source]
  C -->|Hotspot-style| E[Contextual review]
  C -->|Taint-capable rule| F[Inspect source-to-sink flow]
  D --> G[Reanalyze]
  E --> G
  F --> D
  G --> H[Compute Engine result]
  H --> I[Issue state + security rating + gate]
  I --> J[Residual-risk / audit record]

The important causal rule is simple: the UI status does not replace code state. A finding can disappear because the code changed, because a rule/profile changed, because a scope/exclusion changed, or because workflow metadata changed. Those causes are not equivalent and must be distinguished by revision, effective configuration, and history evidence.

4. State map to capture before changing anything

Source state

Commit SHA, branch/main context, indexed files, language, exact vulnerable/hotspot-style line, and test fixture boundaries.

Analyzer state

Community Build/Server version, instance mode, active quality profile, rule key, analyzer/plugin version, and whether advanced taint analysis is actually licensed/supported.

Finding state

Issue/hotspot key, type or software-quality impact, severity/priority, primary/secondary locations, source/sink flow if present, assignee, comments, and status.

Processing state

Scanner version/runtime, report upload, ceTaskId, Compute Engine completion, analysis ID, gate status, and security-rating measures.

Governance state

Why a finding is fixed, accepted, safe, or otherwise dispositioned; reviewer; date; evidence; expiration/revisit condition; and residual limitations.

5. Vulnerability/security issue: remediation is the default outcome

When the analyzer has enough evidence to raise a vulnerability/security issue, treat it as a code defect to investigate and normally fix. Do not downgrade it merely because exploitation is inconvenient in the current environment. Severity is prioritization metadata—not proof of exploitability and not permission to ignore a validated issue.

A proper remediation record pairs the finding with the exact source revision, the source change, a reanalysis task, and the post-analysis state. If the finding remains, the fix was incomplete or the issue has another cause. If it disappears, preserve the new revision and Compute Engine result so the disappearance is attributable to the code change rather than to a policy edit.

6. Hotspot-style finding: review context before disposition

The classic hotspot workflow exists because some security-sensitive constructs are not automatically vulnerable in every context. A secure cryptographic choice, cookie configuration, or permission boundary may depend on surrounding controls. Review therefore asks: what threat does this rule describe, what protection exists, and what evidence supports the conclusion?

Do not use “Safe” as a metric-cleaning button. If your current release still provides the classic hotspot review workflow, the reviewer must record why the code is safe in its real context. If the rule has migrated into the issue workflow, record the same contextual reasoning in the issue history/comment or governance packet instead of pretending the old object still exists.

7. Taint analysis: source → propagation → sink

Taint analysis follows untrusted or sensitive data through the program and looks for a dangerous sink without an adequate sanitizer. A useful finding shows more than a single line: it can show the source, intermediate propagation steps, and sink. This is especially valuable for injection classes because a sink is dangerous only when attacker-controlled data can actually reach it.

# Local teaching-only example. Do not expose as a service.
def run_report(user_value):
    # A taint-capable analyzer may reason about the flow:
    # user_value (source) -> command construction -> shell sink.
    import subprocess
    subprocess.run("report " + user_value, shell=True, check=False)

Current Sonar packaging lists injection-vulnerability taint analysis as a Developer-edition-and-above capability for selected languages including Java, C#, JavaScript/TypeScript, Python, PHP, Kotlin, Go, and VB.NET. Community Build remains the mandatory lab path, so this course does not promise that the example above will produce a flow finding locally. The local fallback teaches the source/sink reasoning manually and uses Community Build for the vulnerability/hotspot-style evidence it actually supports.

8. Security rating and Quality Gate evidence are consequences, not proof

A security rating summarizes analyzer findings under the current rule/profile/mode semantics. It does not test authentication design, runtime deployment, abuse cases, business logic, dependency compromise, infrastructure hardening, penetration resistance, or every exploitable path. Likewise, a passing Quality Gate means that the configured gate conditions passed for the analyzed population—not that the application is secure.

After every security change, preserve: scanner exit status, report-task.txt, Compute Engine task status, resulting issue/hotspot state, security measures, gate state, and the source revision. These facts may all differ.

9. Read-only inspection before any workflow action

git rev-parse HEAD
sonar-scanner --version

# After a scan, preserve the asynchronous task identity:
cat .scannerwork/report-task.txt

# Read-only system/version check:
curl -fsS "$SONAR_HOST_URL/api/system/status"

# Discover security-related rules in the current instance before selecting a fixture.
# Prefer the Rules UI when API fields differ across releases.
curl -fsS -H "Authorization: Bearer $SONAR_TOKEN" \
  "$SONAR_HOST_URL/api/rules/search?languages=py&ps=100"

Do not begin by changing a rule, profile, gate, status, or exclusion. First capture what the current instance actually calls the finding and whether it exposes a classic hotspot object or a migrated issue.

Knowledge check

Why is a Security Hotspot not automatically the same thing as a confirmed vulnerability?

Why must current automation avoid assuming api/hotspots is permanent?

Does scanner exit 0 prove there are no vulnerabilities?

Can Community Build be assumed to produce the same source-to-sink taint findings as Developer edition?

A project has an A security rating. What does that prove?

Next lesson

Turn security concepts into a bounded local review workflow

Lesson 2 builds a disposable Community Build lab around one source remediation and one hotspot-style contextual review.

Official references and version notes

Version and compatibility note

Rechecked 2026-09-08. Mandatory examples target SonarQube Community Build 26.9.0.129388 and SonarScanner CLI 8.1.0.6389. Sonar is actively migrating Security Hotspots into ordinary security issues/vulnerabilities during 2026; classic Hotspot UI/API objects may therefore differ by rule and release, and api/hotspots is deprecated from the 2026.4 server line. The course preserves the durable contextual-review concept while requiring learners to inspect the current object representation. Current product material advertises injection-vulnerability taint analysis in Developer edition and above for selected languages (Java, C#, JavaScript/TypeScript, Python, PHP, Kotlin, Go, VB.NET); the mandatory Community Build lab uses a manual source-to-sink fallback and does not emulate commercial analyzers. Recheck rule classification, migration state, instance mode, analyzer version, and edition/language support before applying automation to another release.

Keep the academy open

Support free, practical DevOps education.

Every lesson is designed to remain readable in a browser, downloadable from GitHub, and usable without a paid learning platform. Contributions help expand and maintain the curriculum.

Ethereum / ERC-20
0x716c4Ab160C4B66F31a28AE2448BfF68fc3a2ef0Send only Ethereum/ERC-20 compatible assets to this address.