Skip to content

Posting a folder config without a path should always be rejected regardless of default folder path settting #10941

Open

Description

@calmh

What happened?

As noted in #10937, the result of posting a new folder config without a path depends on the value of the default folder:

Omitting path can expose other folders to a device they were never shared with. POST /rest/config/folders decodes over a copy of the folder defaults. With an empty default, a folder without a path is refused (folder has empty path - as a 500, though it's a client error). With a default set, it's accepted silently

Syncthing version

current

Platform & operating system

any

Browser version

No response

Relevant log output

Activity

  1. added
    bug
    on Oct 26, 2026
  2. added theissue type on Oct 26, 2026
  3. added
    needs-triage
    on Oct 26, 2026
  4. added a commit that references this issue on Nov 24, 2026
    3d23f92
  5. jonahcwest commented on Nov 24, 2026

    @jonahcwest

    I wrote a fix here that explicitly blanks the folder's path, unmarshals the request body, then checks if the folder is still empty (returning 400 if so).

    This pattern shows up wherever adjustFolder and adjustConfig are called, so the affected API paths are:

    • PUT + POST on /rest/config/folders
    • PUT on /rest/config/folders/:id
    • PUT on /rest/config
    • POST on /rest/system/config
    • PATCH on /rest/config/folders/:id (when setting an empty path)

    Happy to make any changes or open a PR if helpful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugneeds-triage

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions