The SQL Server Unicode Problem Why Your Data Might Not Be Wh...#2488
Open
carlospolop wants to merge 1 commit into
Open
The SQL Server Unicode Problem Why Your Data Might Not Be Wh...#2488carlospolop wants to merge 1 commit into
carlospolop wants to merge 1 commit into
Conversation
Collaborator
Author
🔗 Additional ContextOriginal Blog Post: https://synacktiv.com/en/publications/the-sql-server-unicode-problem-why-your-data-might-not-be-what-you-think-it-is.html Content Categories: Based on the analysis, this content was categorized under "Pentesting Web > Unicode Injection, with references from SQL Injection > MSSQL Injection and XSS / File Inclusion-Path Traversal". Repository Maintenance:
Review Notes:
Bot Version: HackTricks News Bot v1.0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
🤖 Automated Content Update
This PR was automatically generated by the HackTricks News Bot based on a technical blog post.
📝 Source Information
🎯 Content Summary
The post analyzes a dangerous Microsoft SQL Server Unicode/encoding pitfall where data can silently mutate during insertion or implicit conversion. The issue is not a CVE but a design and compatibility problem involving SQL Server character types, collations, non-Unicode string literals, implicit conversion, and Microsoft Windows Best Fit mapping. The security impact is that input that looks harmless before storage can become dangerous after SQL Server converts it into ASCII metachar...
🔧 Technical Details
SQL Server Best Fit payload mutation: When Unicode input is inserted into a narrow SQL Server type such as
CHAR,VARCHAR, orTEXTusing a non-UTF collation/code page, SQL Server does not reject unsupported characters. Instead, it silently applies Microsoft Best Fit mapping. An attacker can submit Unicode characters that are not blocked by application filters, then rely on SQL Server to transform them into dangerous ASCII metacharacters. Example: U+FF1C<becomes<on CP1252, while unmapped characters often become?.Unicode literal pitfall: In SQL Server,
'text'is a non-Unicode literal even if inserted into anNVARCHARcolumn. Unicode literals require theNprefix, for exampleN'👻'. Without this prefix, characters may be converted before assignment and become Best Fit equivalents or fallback bytes such as...🤖 Agent ActionsUpdated
src/pentesting-web/unicode-injection/README.mdwith concise technical content covering SQL Server Best Fit / implicit conversion,N'...'literal pitfalls, stored XSS, path traversal/LFI mutation,?fallback, collation collisions, and references.This PR was automatically created by the HackTricks Feed Bot. Please review the changes carefully before merging.
📚 Repository Maintenance
All .md files have been checked for proper formatting (headers, includes, etc.).