Files
codeql/csharp/ql/test/query-tests/Security Features/CWE-134/UncontrolledFormatStringBad.cs
2019-03-06 08:15:46 +01:00

15 lines
345 B
C#

using System.Web;
public class HttpHandler : IHttpHandler
{
string Surname, Forenames, FormattedName;
public void ProcessRequest(HttpContext ctx)
{
string format = ctx.Request.QueryString["nameformat"];
// BAD: Uncontrolled format string.
FormattedName = string.Format(format, Surname, Forenames);
}
}