Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,18 @@ Available features:
* Interfile analysis - Kotlin is fully supported
* Interfile analysis - Android is partially supported

### Template file analysis

Snyk Code parses template files and follows data from your application code into the template, so it reports a cross-site scripting vulnerability that becomes exploitable only where the template renders its output.

For Java and Kotlin, Snyk Code supports the following template engines:

* FreeMarker
* Thymeleaf
* Velocity

For file extensions and the full set of supported language and template engine combinations, visit [Template file analysis](../../supported-languages/technical-specifications-and-guidance.md#template-file-analysis).

## Java and Kotlin for Snyk Open Source

For Java and Kotlin with Snyk Open Source, the following file formats are supported:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,17 @@ For .NET with Snyk Code, the following frameworks and libraries are supported:
* Reports
* Interfile analysis

### Template file analysis

Snyk Code parses template files and follows data from your application code into the template, so it reports a cross-site scripting vulnerability that becomes exploitable only where the template renders its output.

For C#, Snyk Code supports the following template engines:

* Mustache
* Razor

For file extensions and the full set of supported language and template engine combinations, visit [Template file analysis](../../technical-specifications-and-guidance.md#template-file-analysis).

## .NET for Snyk Open Source

{% hint style="info" %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,15 @@ For Groovy, Snyk supports the following file extensions:

* Support for Interfile analysis
* Reports

### Template file analysis

Snyk Code parses template files and follows data from your application code into the template, so it reports a cross-site scripting vulnerability that becomes exploitable only where the template renders its output.

For Groovy, Snyk Code supports the following template engines:

* FreeMarker
* Thymeleaf
* Velocity

For file extensions and the full set of supported language and template engine combinations, visit [Template file analysis](../technical-specifications-and-guidance.md#template-file-analysis).
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,19 @@ The following file formats are supported: `.ejs`, `.es`, `.es6`, `.htm`, `.html`
* Reports
* Interfile analysis

### Template file analysis

Snyk Code parses template files and follows data from your application code into the template, so it reports a cross-site scripting vulnerability that becomes exploitable only where the template renders its output.

For JavaScript, Snyk Code supports the following template engines:

* EJS
* Handlebars
* Mustache
* Pug

For file extensions and the full set of supported language and template engine combinations, visit [Template file analysis](../../technical-specifications-and-guidance.md#template-file-analysis).

## JavaScript for Snyk Open Source

### Supported package managers and package registries
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,16 @@ For PHP, the following frameworks and libraries are supported:

The following file formats are supported: `.php`, `.phtml`, `.module`, `.inc`, `.install`, `.theme`, `.profile`.

### Template file analysis

Snyk Code parses template files and follows data from your application code into the template, so it reports a cross-site scripting vulnerability that becomes exploitable only where the template renders its output.

For PHP, Snyk Code supports the following template engines:

* Twig

For file extensions and the full set of supported language and template engine combinations, visit [Template file analysis](../technical-specifications-and-guidance.md#template-file-analysis).

## PHP for Snyk Open Source

For PHP with Snyk Open Source, PHP versions 5.2 through 8.5 are supported.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,17 @@ Snyk Code relies on Python projects to follow a standard directory layout for ac

Both `src-layout` and `flat-layout` are supported. Proper adherence to these conventions allows the scanner to trace code effectively and provide accurate results.

### Template file analysis

Snyk Code parses template files and follows data from your application code into the template, so it reports a cross-site scripting vulnerability that becomes exploitable only where the template renders its output.

For Python, Snyk Code supports the following template engines:

* Jinja2
* Mako

For file extensions and the full set of supported language and template engine combinations, visit [Template file analysis](../../technical-specifications-and-guidance.md#template-file-analysis).

## Python for Snyk Open Source

{% hint style="info" %}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,30 @@ Partial support includes:

Snyk continuously expands its framework coverage and improves analysis accuracy.

### Template file analysis

Snyk Code analyzes template files together with the application code that renders them. Snyk Code follows data that reaches a template from your application code into the template, so it reports a cross-site scripting vulnerability that becomes exploitable only where the template writes its output. The reported data flow spans both the application code and the template.

Snyk Code takes the escaping behavior of the template engine into account. Snyk Code does not report output written through the default escaping of the engine. Snyk Code treats output written through a construct that bypasses escaping, such as a raw or unescaped directive, as a sink.

Support is defined by the pairing of a template engine with the language that renders the template. The following pairs are supported. Template files are analyzed in addition to the source file formats listed for each language.

| Template engine | File extensions | Languages |
| :--- | :--- | :--- |
| EJS | `.ejs` | JavaScript |
| FreeMarker | `.ftl`, `.ftlh`, `.ftlx` | Java, Kotlin, Groovy |
| Handlebars | `.hbs`, `.handlebars` | JavaScript |
| Jinja2 | `.j2`, `.jinja`, `.jinja2` | Python |
| Mako | `.mako` | Python |
| Mustache | `.mustache`, `.mu` | JavaScript, C# |
| Pug | `.pug`, `.jade` | JavaScript |
| Razor | `.cshtml`, `.razor` | C# |
| Thymeleaf | `.html` | Java, Kotlin, Groovy |
| Twig | `.twig` | PHP |
| Velocity | `.vm`, `.vtl` | Java, Kotlin, Groovy |

Snyk is expanding this coverage. If a template engine or a pair you use is not listed, [contact Snyk Support](https://support.snyk.io).

### How Snyk Code analysis works

Snyk scans your codebase following this sequence:
Expand Down
1 change: 1 addition & 0 deletions scan-fix-and-prevent/scan-with-snyk/snyk-code/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ Snyk Code is powered by a semantic, AI-based analysis engine and can analyze the
<figure><img src="../../.gitbook/assets/Introduction - AI Engine - Hardcoded secrets.png" alt="Hardcoded secret found"><figcaption><p>Hardcoded secret found</p></figcaption></figure>

* Point-to analysis: Identifies multiple potential issues, including buffer overruns, null dereferences, and type mismatches, by modeling memory use in variables and references.
* Template files: Follows data from your application code into the template that renders it, so cross-site scripting that becomes exploitable only at the point of rendering is reported. Visit [Template file analysis](../../../discover-snyk/supported-languages/technical-specifications-and-guidance.md#template-file-analysis).
* Type inference: Determines the initial type and its changes. This is of special interest for dynamically typed languages.
* Value ranges: Infers possible values for variables used to call functions to track off-by-one errors in arrays, division-by-zero errors, and null dereferences.

Expand Down
Loading