mirror of
https://github.com/github/codeql.git
synced 2026-07-15 08:18:18 +02:00
22 lines
576 B
C#
22 lines
576 B
C#
using System;
|
|
using System.Web;
|
|
using System.Reflection;
|
|
|
|
public class DLLInjectionHandler : IHttpHandler {
|
|
public void ProcessRequest(HttpContext ctx) {
|
|
string libraryName = ctx.Request.QueryString["libraryName"]; // $ Source=r1
|
|
|
|
// BAD: Load DLL based on user input
|
|
var badDLL = Assembly.LoadFile(libraryName); // $ Alert=r1
|
|
|
|
// GOOD: Load DLL using fixed string
|
|
var goodDLL = Assembly.LoadFile(@"C:\visual studio 2012\Projects\ConsoleApplication1\ConsoleApplication1\DLL.dll");
|
|
}
|
|
|
|
public bool IsReusable {
|
|
get {
|
|
return true;
|
|
}
|
|
}
|
|
}
|