Heap-based buffer overflow in the sqlpreparewhere function (contrib/modsql.c) in ProFTPD before 1.3.3d, when modsql is enabled, allows remote attackers to cause a denial of service (crash) and possibly execute arbitrary code via a crafted username containing substitution tags, which are not properly handled during construction of an SQL query.