VS Code | Using SonarLint | Taint vulnerabilities

Was this page helpful?

On this page

Install Free

Taint vulnerabilities

Taint vulnerabilities are a type of security-related rules, that can be raised by both SonarCloud and SonarQube (starting with Developer Edition). 

Due to technical limitations, SonarLint can not raise taint issues on local analysis and instead pulls taint issues from SonarQube or SonarCloud following a project analysis. Because SonarLint must pull taint vulnerability issues from SonarQube or SonarCloud, the use of Connected Mode is required.

Prerequisites

  • You must bind your project to an instance of SonarQube Developer Edition (or higher) 8.9+ or to SonarCloud.
  • For this feature to be valuable, your project needs to be analyzed frequently (ideally by your CI server when pushing new code).
  • When running in Connected Mode with SonarCloud, you must work with long-lived branches. Issues on short-lived branches are not synchronized; SonarQube does not distinguish between long- and short-lived branches. 

How to display taint vulnerabilities

  1. Bind your project to SonarQube or SonarCloud.
  2. In the standard VS Code Panel below the editor region, select the PROBLEMS panel.
  3. Along with regular issues, the PROBLEMS panel should display the list of taint vulnerabilities that are present in the bound folder. SonarLint displays taint vulnerabilities for the entire project.

How to fix your taint issues

Taint vulnerabilities are security-related rule issues that are only raised by SonarQube (starting with Developer Edition) and SonarCloud. Due to technical limitations, SonarLint can not raise such issues on local analysis. 

Because the detection of taint issues requires that you are run in Connected Mode, any changes you make to the code must be resolved by your SonarQube or SonarCloud instance. Here are two options to resolve taint issues displayed by SonarLint:

  • If you fix the issue locally, commit your code to the server and rerun the analysis on SonarQube or SonarCloud. The new status (of the issue) will show up automatically in your local analysis.
  • If you go to the issue in SonarQube or SonarCloud and mark it as fixed, false positive, or won’t fix, in less than 1 minute, the new status will be updated locally.

© 2008-2024 SonarSource SA. All rights reserved. SONAR, SONARSOURCE, SONARLINT, SONARQUBE, SONARCLOUD, and CLEAN AS YOU CODE are trademarks of SonarSource SA.

Creative Commons License