I came to know the SQL truncation vulnerability that I wasn't aware of. It is my understanding that this vulnerability is based on the fact that MySQL truncates the value of an "insert query" whether the value exceeds the width of the corresponding column. The fist appearance of this vulnerability is in CVE-2008-4106 which reports the problem in the WordPress CMS. The CVE reports that the problem was related to a WordPress implementation. But I would have said that this is a problem related to the MySQL implementation that truncates the input instead of raising an error and blocking the query.
So is SQL truncation vulnerability a problem in the DBMS (MySQL) or in the web application that doesn't check the string length?
I installed the latest version of MySQL (5.5) in order to make some tests and apparently if the inserted value exceeds the column width, I receive an error:
Error: Data too long for column 'name' at row 1
and the query is not performed. This suggests me that MySQL now implements a better check for input length and thus the web application shouldn't be responsible for this check. What am I missing?