Skip to content

Two small parsing defects: console connect splits credentials on a single space; Studio graph widget HTML-escapes the database name into a URL path #6830

Closed

Description

@ruispereira

Two small, independent defects found while auditing the console argument parsing and the Studio graph widget. Both are one-line fixes; grouping them to keep the tracker tidy.

1. connect remote: splits on a single space and demands exactly 3 tokens

console/src/main/java/com/arcadedb/console/Console.java:1240-1242:

final String[] serverUserPassword = conn.trim().split(" ");
if (serverUserPassword.length != 3)
  throw new ConsoleException("URL username and password are missing");

split(" ") produces empty tokens for runs of whitespace, and there is no quoting escape hatch: the parser deliberately keeps the quote characters in the word (TerminalParser.java:141, :150), so connect remote:h/db root "my pass" arrives as four tokens.

Repro - both fail with "URL username and password are missing" although both values are present:

connect remote:localhost/mydb root "my pass"
connect remote:localhost/mydb root  secret      (two spaces)

A password containing a space is accepted by the server and by Studio, so such an account is simply unusable from the console, and the diagnostic sends the user looking for the wrong problem.

Fix: conn.trim().split("\\s+", 3) so the password keeps its spaces, and split the error message into "missing username/password" versus "unexpected extra token".

Note: executeCreateUser does reject passwords with spaces (checkHasSpaces("User password", ...), :579), but that only covers users created from the console, not accounts created over HTTP/Studio or migrated, and it does not explain rejecting root secret. RemoteConsoleIT only uses space-free credentials.

2. Studio HTML-escapes the database name into a URL path

studio/src/main/resources/static/js/studio-graph-widget.js:696:

url: "api/v1/command/" + escapeHtml(getCurrentDatabase()),

escapeHtml() (studio-utils.js:159-166) is an HTML-entity encoder, not a URL encoder: & becomes &, ' becomes ', " becomes ", and a null input returns null (stringified into the URL as "null").

This is the only one of the ~40 api/v1/{command,query}/ call sites in the Studio that transforms the database name at all; every other one concatenates it raw, including the neighbouring request at :590 in the same file. So it reads as a copy/paste of the wrong helper rather than a convention.

Repro: with a database whose name contains &, ', ", < or >, "add node from record" in the graph widget POSTs to api/v1/command/a&amp;b, the server answers 404, and data.result.vertices[0] (:707) leaves vertex null - while the same action from any other Studio panel works.

Fix: encodeURIComponent(getCurrentDatabase()) here, and ideally at the other call sites too, which have the mirror-image problem with /, # and spaces.

Activity

  1. added this to the 26.9.1 milestone on Aug 27, 2026
  2. added
    console
    on Aug 27, 2026
  3. added
    in progress
    on Aug 27, 2026
  4. self-assigned this
    on Aug 27, 2026
  5. added a commit that references this issue on Aug 28, 2026
  6. lvca commented on Aug 28, 2026

    @lvca
    Member

    Both fixed in 26.9.1.

    Console connect now splits on any run of whitespace and keeps the password whole, so extra spaces and passwords containing spaces both work. When something is missing, the error says which half rather than claiming both are. create user no longer rejects a password with spaces either, so any account the server accepts can now be created and used from the console.

    Studio built the URL with an HTML encoder, which turned a name like a&b into a&amp;b and produced a 404. All Studio requests now encode the database name properly, so names with &, ', /, # or a space work everywhere.

    Two related problems turned up in the same code and are fixed too: creating a database from Studio ran the typed name through a URL encoder, so my db actually created a database named my%20db; and a name containing a quote broke the create/drop/reset requests outright.


    ❤️ Thanks for helping make ArcadeDB better! ArcadeDB is free and open source, sustained by its community. If it's useful to you or your company, please consider becoming a sponsor to keep development going.

  7. removed
    in progress
    on Aug 28, 2026
  8. ruispereira commented on Aug 31, 2026

    @ruispereira
    ContributorAuthor

    Validated against main at 55e00aaa6. Part 1 (console connect) is fully fixed, and the Studio half is fixed for the whole api/v1/command/api/v1/query class - all 50 sites now go through encodeDatabaseName().

    Three api/v1/ts/ sites in studio-timeseries.js were missed, in the same file the fix converted six command URLs in. Filed as #6947 rather than reopening here, since it also needs the invariant test's regex widened.

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

Metadata

Metadata

Assignees

Labels

bugconsole

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions