Skip to content

The SQL Server Unicode Problem Why Your Data Might Not Be Wh...#2488

Open
carlospolop wants to merge 1 commit into
masterfrom
update_The_SQL_Server_Unicode_Problem_Why_Your_Data_Mig_5f37b972d2d06475
Open

The SQL Server Unicode Problem Why Your Data Might Not Be Wh...#2488
carlospolop wants to merge 1 commit into
masterfrom
update_The_SQL_Server_Unicode_Problem_Why_Your_Data_Mig_5f37b972d2d06475

Conversation

@carlospolop

Copy link
Copy Markdown
Collaborator

🤖 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, or TEXT using 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 an NVARCHAR column. Unicode literals require the N prefix, for example N'👻'. Without this prefix, characters may be converted before assignment and become Best Fit equivalents or fallback bytes such as ...

🤖 Agent Actions

Updated src/pentesting-web/unicode-injection/README.md with 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

  • MD files processed: 981
  • MD files fixed: 1

All .md files have been checked for proper formatting (headers, includes, etc.).

@carlospolop

Copy link
Copy Markdown
Collaborator Author

🔗 Additional Context

Original 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:

  • MD Files Formatting: 981 files processed (1 files fixed)

Review Notes:

  • This content was automatically processed and may require human review for accuracy
  • Check that the placement within the repository structure is appropriate
  • Verify that all technical details are correct and up-to-date
  • All .md files have been checked for proper formatting (headers, includes, etc.)

Bot Version: HackTricks News Bot v1.0

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant