spring-projects / spring-projects/spring-security

Illegal group reference

Open
#15,458 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

in: crypto status: feedback-provided
Dominant language
Java
Stars
9.6k
Forks
6.3k
Avg merge
2d 11h
Merged PRs (30d)
52

Description

java.lang.IllegalArgumentException: Illegal group reference
at java.base/java.util.regex.Matcher.appendExpandedReplacement(Matcher.java:1067)
at java.base/java.util.regex.Matcher.appendReplacement(Matcher.java:997)
at java.base/java.util.regex.Matcher.replaceFirst(Matcher.java:1407)
at java.base/java.lang.String.replaceFirst(String.java:2900)
at com.linkkou.mybatis.log.LogInterceptor.replaceFirst(LogInterceptor.java:152)
at com.linkkou.mybatis.log.LogInterceptor.getCompleteSql(LogInterceptor.java:123)
Occurs when storing encrypted data Error:
BCryptPasswordEncoder passwordEncoder = new BCryptPasswordEncoder();
// password include:
return passwordEncoder.encode(password);
image
Will consider $ xxx $ to be regular
This method will be called automatically: at java.base/java.util.regex.Matcher.appendExpandedReplacement(Matcher.java:1067)

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with com.linkkou.mybatis.log.LogInterceptor.replaceFirst and getCompleteSql, using the reported BCryptPasswordEncoder case with a password containing '$' to reproduce the exception. Trace the replaceFirst call and verify that SQL logging completes without IllegalArgumentException while preserving the intended logged output.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.