CodeQL for research at scale
💻

CodeQL for research at scale

Edited
Oct 5, 2025 10:55 PM
Tags
pwnctfprogrammingweb

Intro

I decided to get back into more hardcore security research, and try to augment it with AI. After some research, I think learning CodeQL and then enhancing it with AI support might yield good results. Thus, this post will go over my learning process for it. These are just notes, and might not make sense, so feel free to reach out to me if you have questions that I might be able to answer.

Test Case

Code for submitting user controlled data to the application
package services

import (
	"Desires/utils"
	"bytes"
	"crypto/sha256"
	"encoding/json"
	"fmt"
	"log"
	"net/http"
	"os"
	"path/filepath"
	"strconv"
	"strings"
	"time"

	"github.com/google/uuid"

	"github.com/gofiber/fiber/v2"
	"github.com/mholt/archiver/v3"
)
Imported packages
import go

from Function f
select f, f.getQualifiedNamed()
image
graph TD
    A["Input: c *fiber.Ctx"] --> B["c.FormFile('archive')"]
    B --> C["file, err := c.FormFile('archive')"]
    C --> D["c.SaveFile(file, filepath.Join('./uploads', filename))"]
 
    
image
image
image
image
image
Getting all function calls and their exact locations including start and end columns.
Getting all function calls and their exact locations including start and end columns.
image