Skip to content

#AI COMMIT# Fix JDBC URL encoding bypass and unsafe deserialization v…#5438

Merged
casionone merged 1 commit into
masterfrom
fix/security-jdbc-deser-vuln
Jun 11, 2026
Merged

#AI COMMIT# Fix JDBC URL encoding bypass and unsafe deserialization v…#5438
casionone merged 1 commit into
masterfrom
fix/security-jdbc-deser-vuln

Conversation

@aiceflower

Copy link
Copy Markdown
Member

…ulnerabilities

  1. SecurityUtils.checkParams: Replace single URL decode with while-loop decode (consistent with checkJdbcConnParams) to prevent double-encoding bypass that allows attackers to smuggle sensitive params like allowLoadLocalInfile past the blacklist.

  2. SqlConnection (4 files): Replace DriverManager.getConnection(url,user,pwd) with getConnection(baseUrl, Properties). Security params are set first via SecurityUtils.getMysqlSecurityParams() and cannot be overridden by user-supplied extra params, providing defense-in-depth against URL parameter injection.

  3. CryptoUtils.string2Object: Add resolveClass whitelist allowing only java.lang.String, blocking all gadget chain deserialization attacks (CWE-502) while maintaining backward compatibility since passwords are stored as String objects.

What is the purpose of the change

EngineConn-Core defines the the abstractions and interfaces of the EngineConn core functions.
The Engine Service in Linkis 0.x is refactored, EngineConn will handle the engine connection
and session management.

Related issues/PRs

Related issues: close #590 close #591
Related pr:#591

Brief change log

  • Define the core abstraction and interfaces of the EngineConn Factory;
  • Define the core abstraction and interfaces of Executor Manager.

Checklist

  • I have read the Contributing Guidelines on pull requests.
  • I have explained the need for this PR and the problem it solves
  • I have explained the changes or the new features added to this PR
  • I have added tests corresponding to this change
  • I have updated the documentation to reflect this change
  • I have verified that this change is backward compatible (If not, please discuss on the Linkis mailing list first)
  • If this is a code change: I have written unit tests to fully verify the new behavior.

…ulnerabilities

1. SecurityUtils.checkParams: Replace single URL decode with while-loop
   decode (consistent with checkJdbcConnParams) to prevent double-encoding
   bypass that allows attackers to smuggle sensitive params like
   allowLoadLocalInfile past the blacklist.

2. SqlConnection (4 files): Replace DriverManager.getConnection(url,user,pwd)
   with getConnection(baseUrl, Properties). Security params are set first
   via SecurityUtils.getMysqlSecurityParams() and cannot be overridden by
   user-supplied extra params, providing defense-in-depth against URL
   parameter injection.

3. CryptoUtils.string2Object: Add resolveClass whitelist allowing only
   java.lang.String, blocking all gadget chain deserialization attacks
   (CWE-502) while maintaining backward compatibility since passwords
   are stored as String objects.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

@casionone casionone left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@casionone casionone merged commit 44c38c4 into master Jun 11, 2026
16 of 22 checks passed
@casionone casionone deleted the fix/security-jdbc-deser-vuln branch June 11, 2026 07:43
aiceflower added a commit to aiceflower/linkis that referenced this pull request Jun 15, 2026
…ulnerabilities (apache#5438)

1. SecurityUtils.checkParams: Replace single URL decode with while-loop
   decode (consistent with checkJdbcConnParams) to prevent double-encoding
   bypass that allows attackers to smuggle sensitive params like
   allowLoadLocalInfile past the blacklist.

2. SqlConnection (4 files): Replace DriverManager.getConnection(url,user,pwd)
   with getConnection(baseUrl, Properties). Security params are set first
   via SecurityUtils.getMysqlSecurityParams() and cannot be overridden by
   user-supplied extra params, providing defense-in-depth against URL
   parameter injection.

3. CryptoUtils.string2Object: Add resolveClass whitelist allowing only
   java.lang.String, blocking all gadget chain deserialization attacks
   (CWE-502) while maintaining backward compatibility since passwords
   are stored as String objects.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
aiceflower added a commit to aiceflower/linkis that referenced this pull request Jun 15, 2026
…ulnerabilities (apache#5438)

1. SecurityUtils.checkParams: Replace single URL decode with while-loop
   decode (consistent with checkJdbcConnParams) to prevent double-encoding
   bypass that allows attackers to smuggle sensitive params like
   allowLoadLocalInfile past the blacklist.

2. SqlConnection (4 files): Replace DriverManager.getConnection(url,user,pwd)
   with getConnection(baseUrl, Properties). Security params are set first
   via SecurityUtils.getMysqlSecurityParams() and cannot be overridden by
   user-supplied extra params, providing defense-in-depth against URL
   parameter injection.

3. CryptoUtils.string2Object: Add resolveClass whitelist allowing only
   java.lang.String, blocking all gadget chain deserialization attacks
   (CWE-502) while maintaining backward compatibility since passwords
   are stored as String objects.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
aiceflower added a commit to WeDataSphere/linkis that referenced this pull request Jun 15, 2026
…ulnerabilities (apache#5438)

1. SecurityUtils.checkParams: Replace single URL decode with while-loop
   decode (consistent with checkJdbcConnParams) to prevent double-encoding
   bypass that allows attackers to smuggle sensitive params like
   allowLoadLocalInfile past the blacklist.

2. SqlConnection (4 files): Replace DriverManager.getConnection(url,user,pwd)
   with getConnection(baseUrl, Properties). Security params are set first
   via SecurityUtils.getMysqlSecurityParams() and cannot be overridden by
   user-supplied extra params, providing defense-in-depth against URL
   parameter injection.

3. CryptoUtils.string2Object: Add resolveClass whitelist allowing only
   java.lang.String, blocking all gadget chain deserialization attacks
   (CWE-502) while maintaining backward compatibility since passwords
   are stored as String objects.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
aiceflower added a commit to WeDataSphere/linkis that referenced this pull request Jun 16, 2026
…ulnerabilities (apache#5438)

1. SecurityUtils.checkParams: Replace single URL decode with while-loop
   decode (consistent with checkJdbcConnParams) to prevent double-encoding
   bypass that allows attackers to smuggle sensitive params like
   allowLoadLocalInfile past the blacklist.

2. SqlConnection (4 files): Replace DriverManager.getConnection(url,user,pwd)
   with getConnection(baseUrl, Properties). Security params are set first
   via SecurityUtils.getMysqlSecurityParams() and cannot be overridden by
   user-supplied extra params, providing defense-in-depth against URL
   parameter injection.

3. CryptoUtils.string2Object: Add resolveClass whitelist allowing only
   java.lang.String, blocking all gadget chain deserialization attacks
   (CWE-502) while maintaining backward compatibility since passwords
   are stored as String objects.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants