GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Java: Introduce Freemarker for SSTI queries by japroc · Pull Request #6320 · github/codeql

Conversation

@japroc

@japroc japroc commented Jul 18, 2021

Copy link
Copy Markdown
Contributor

Hi team!

I want to add support for Freemarker template engine.
There is a Freemarker.qll library and 2 queries.

Query 1 - FreemarkerTaintedTemplate.ql
Search for cases when untrusted data is used as template. It may lead to remote code execution and information disclosure vulnerabilities.

Query 2 - FreemarkerUnsafeConfiguration.ql
Search for unsafe freemarker configurations. It is not critical by default. Although, when developers use builtin interpret filter on user-data, they will be executed as part of template. As i know it's impossible to analyze ftl files. As mitigation it's recommended to configure secure engine by 1) not enabling Builtin API, 2) setting class resolver to ALLOWS_NOTHING_RESOLVER.

Thanks,
Evgenii.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@japroc
Introduce Freemarker
b93aaea
@japroc
japroc requested a review from a team as a code owner July 18, 2021 18:30
@github-actions github-actions Bot added documentation Java labels Jul 18, 2021
@intrigus-lgtm

intrigus-lgtm commented Jul 19, 2021

Copy link
Copy Markdown
Contributor

FYI: There is a similar PR #5935

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@smowton

smowton commented Jul 19, 2021

Copy link
Copy Markdown
Contributor

In the event they differ enough: @japroc are you applying to the bounty program for this?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@japroc

japroc commented Jul 20, 2021 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

Hi @intrigus-lgtm and @smowton,

Unfortunately, i have not seen that PR (#5935) earlier. It looks similar. I think mine FreemarkerTaintedTemplate.ql covers same vulnerabilities.
Although this PR also contains FreemarkerUnsafeConfiguration.ql query. It's description is in first comment of this PR.

In the event they differ enough: @japroc are you applying to the bounty program for this?

Yes, i wanted to apply for bounty after some discussion

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

japroc and others added 2 commits July 28, 2021 20:12
@japroc
add freemarker setSetting flow
e715c17
Evgenii
java. freemarker. add allowNothing variation
0427366

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

No reviews

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

documentation Java

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@japroc @intrigus-lgtm @smowton
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.