PaperMC / PaperMC/Paper

level-name in server.properties not being input sanitized

Open
#13,893 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: needs triage upstream: vanilla version: 26.1.2
Dominant language
Java
Stars
12.7k
Forks
3.5k
Avg merge
3d 13h
Merged PRs (30d)
11

Description

Expected behavior

users not being able to set

level-name=

and it leading to creation of a world with empty string as a name, leading to plugin errors, because there was an assumption that world name is not an empty string.

Observed/Actual behavior
level-name=

results in creation of the world in the server root directory.

level-name=../

will attempt to create the world in the parent directory and

level-name=/home/someuser/world

will create it on the absolute path

all cases are likely to break plugin configs relying on the world name

Steps/models to reproduce
  1. start a clean server
  2. set level-name= in server-properties
  3. see all the world files dumped in the server root directory
Plugin and Datapack List

n/a

Paper version

26.1.2-x (present in vanilla, bug report)

Other

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with the documented server.properties values, then trace how level-name is read and passed into world creation. Check the existing validation and world-path handling; done means empty, parent-directory, and absolute-path values are handled safely without creating worlds under unintended locations, with regression coverage for the reported cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend, security
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.