page me maybe: a sqlite page size, and a field name split in the wrong place

huntress ctf 2026, day 23 · metadata forensics · all three modes

tools used: archive and metadata readers and timed-attempt pipeline.

"application databases have been copied, truncated, embedded, and mislabeled. validate page geometry, connect databases to parent applications, and find the impossible claim." the day's new family was sqlite, and its first property was the database's page size.

the key insight: the page size is a header field, two bytes at offset 16, and we had read it since day 14. the miss was in the name, not the bytes: the field id ends in the words size-bytes, which is also the name of a generic property (a member's length), and the solver split the id there.

challenge shape

single         1 field     sqlite.page_size_bytes of one database
time trial    28 fields    the new property beside one from each earlier
                           day, member hashes and sizes, and a synthesis
                           field across named members
mastery      196 fields    the same over seven sets

artifact anatomy

the evidence zip carries database-001.sqlite. a sqlite file is a sequence of equal-sized pages; the first page opens with a 100-byte header:

offset  size  field
0       16    "SQLite format 3\0"
16      2     page size, big-endian; a power of two from 2^9 to 2^15,
              or 1 meaning 2^16
18      1     file format write version (1 legacy, 2 wal)
19      1     file format read version
20      1     reserved bytes at the end of each page
24      4     file change counter
28      4     database size in pages
56      4     text encoding (1 utf-8, 2 utf-16le, 3 utf-16be)
68      4     application id
96      4     sqlite version number that last wrote the file

the prompt's "page geometry" is the relation between those fields and the file: a complete database is page size times page count bytes long, so a truncated copy is shorter than its own header claims, and a database appended to another file starts at its magic instead of offset 0.

extraction method

the record reader parses the header into named values; the page size is

raw = int.from_bytes(data[16:18], "big")
page_size = 1 << 16 if raw == 1 else raw

the field id was d23-sqlite-001-sqlite-page-size-bytes. the property splitter knew two ways to cut an id: at the member stem (d23-sqlite-001, a family word between a day tag and a number), or at the longest known property suffix. size-bytes is a known suffix (the generic file-size property) and it is longer than nothing, so the splitter took the stem to be d23-sqlite-001-sqlite-page and answered that member's length. a stem of the dNN-<family>-NNN shape now ends the split: everything after it is the property, and sqlite-page-size-bytes reaches the sqlite record by its words.

FIELD_STEM = re.compile(r"((?:set\d+\.)?(?:slot\d+_)?d\d\d-[a-z0-9]+-\d+)-(.+)")
stem = FIELD_STEM.fullmatch(field)
if stem:
    return stem.group(1), stem.group(2)

validation and answer formatting

the answer is a base-10 integer, 4096 for the single, 4096 for the time trial and 32768, 1024, 4096 and four more for the mastery's seven sets. the value 1 must be read as 2^16 (the field is too narrow to hold it), and a value that is not a power of two in range is not a page size at all.

the time trial's earlier properties brought one surprise. the member-name field of a zip asks for zip.central_directory_member_names as a compact json array "with exact values and order". through day 22 the archives were written with their entries already in name order, so directory order and sorted order were the same list. on day 23 the entries were shuffled, and the grader took the names sorted ascending, not in directory order. the reader now answers both lists as ranked candidates, sorted first. the graded form, by hand:

names = zipfile.ZipFile(path).namelist()     # central-directory order
answer = json.dumps(sorted(names), separators=(",", ":"))

failed approaches and pivots

the single's first answer was the database file's length: the generic property answered the right member with the wrong property. a value read from the wrong field is plausible in shape (an integer, in bytes), so nothing in the format check could catch it; only the field name could.

automation across modes

one record reader answers the page size in every set; the earlier days' properties come from their own readers. the member-name order is the only change the timed modes needed.

lessons

solve times

public scoreboard · day 23 finish: 1st

  • 0:15.7single#15 of 170 solvers
  • 1:13.3time trial#2 of 163 solvers
  • 1:15.4mastery#2 of 160 solvers
  • #1team day finishof 140 teams that cleared it, in 8:58.5
  • #5single orderof the day's 8, by our flag time

from the public scoreboard: 09:00 et release to our flag; the table below counts from our attempt's start.

from the mode's first attempt start to its flag (server times). attempts counts our solver runs.

mode work to flag attempts wrong submits
single 14.6s 2 1
time trial 56.7s 2 7
mastery 1.4s 1 0

the clock

server timer of the winning attempt; used is attempt start to flag, left is what remained on the clock.

mode time available time used time left
time trial 50.0s 0.6s 49.4s
mastery 230.0s 1.4s 228.6s

where we got stuck

flags: single, time trial, and mastery [redacted].

{generated by a clanker}