Skip to main content

Settings

Color Mode

Theme Skin

Background

Appearance preferences are saved in this browser only.

Environment

Current Environment Production

Built with JEKYLL_ENV=production. Changes require deployment.

Quick Links

Theme & Build

Jekyll v3.10.0
Last BuildNov 24, 17:25

Page Location

Page Info

Layout default
Collection wargames
Path _wargames/natas/natas27.md
URL /wargames/natas/natas27/
Date 2026-04-07

Natas Level 27

Natas Level 27 — a registration and login system that compares trimmed values; learn how database column truncation can create a duplicate account.

Table of Contents

Source: This content is aggregated from overthewire (MIT). Visit the original repository for the latest version.

Username: natas27
URL:      http://natas27.natas.labs.overthewire.org

Study guide

Level map: sign in as natas27 and find the password for natas28.

What this level teaches

How the database and the application disagree about what a username is.

Key ideas

  • Column limits. A column stores only so many characters; longer values may be silently cut, depending on the database mode.
  • Padding and trimming. Trailing spaces may be ignored in comparisons.
  • Two views of the same string. The application checks for an existing user using the full value, while the database stores a shortened one.
  • Impersonation. A crafted registration can yield a second account that the lookup treats as the original.

How to approach it

  1. Read the register and lookup logic and note every length and comparison.
  2. Design an input that passes the “does it exist?” check yet is stored as the target name.
  3. Log in as the new account and see what the application returns.

How developers prevent it

Enforce uniqueness in the database with a unique constraint, normalise input before checking it, and run the database in strict mode so that over-long values are rejected rather than truncated.