Skip to content

Open-source AI coworkers that each get a computer of their own: a browser, files and tools, with every action decided before it happens and recorded after. Bring any AG-UI agent.

fix(config): a public name starting 127. is not loopback for OPENBOT_SINGLE_USER (#744)

Charan Rathoreab62ef256619
diff --git a/CHANGELOG.md b/CHANGELOG.md
index da1fd3d1..65aa4ea3 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -8,6 +8,23 @@ Newest first. `Unreleased` is what is on `main` and not yet tagged.
## Unreleased
+- `OPENBOT_SINGLE_USER` is now refused with a public name that starts with `127.`, such as
+ `https://127.example.com` or `https://127.0.0.1.nip.io`. The check for a loopback address matched
+ any host beginning `127.`, so a public address like that read as this machine and the no-sign-in
+ administrator was allowed on it. Only a full 127.x.x.x address counts as loopback now.
+- A cancellation the native host never collected is now dropped instead of being reported as
+ pending forever. Every timed-out, stopped or revoked host operation queues a cancel for the desktop
+ worker, and only that worker ever removed it: a worker that stopped polling left the entry in
+ memory for the life of the process, so the Host access panel showed an operation that could never
+ finish. A desktop that reconnects within the operation timeout is still told to stop.
+- A Bot's shell now honours a Stop that landed before the command was spawned, not only one that
+ arrives afterwards. A person who pressed Stop in the window between the request reaching the
+ computer and the command starting got no answer until that command finished on its own.
+- A file download refused because the computer's response carried no usable byte length now releases
+ the connection before reporting the refusal. The unread body could be as large as the whole
+ download budget, so a computer reached through a proxy that re-chunks left a transfer running and a
+ connection checked out of the pool on every attempt.
+
- A conversation title cut at 60 characters no longer ends in half an emoji. `slice` counts UTF-16
code units and an emoji is two of them, so a title cut between the halves rendered a replacement
character in the sidebar and the picker, where the character itself should have been.
diff --git a/server/src/config.ts b/server/src/config.ts
index 34e28a70..bb557c66 100644
--- a/server/src/config.ts
+++ b/server/src/config.ts
@@ -528,7 +528,7 @@ function reachOf(raw: string): Reach {
bare === "localhost" ||
bare === "::1" ||
bare === "0:0:0:0:0:0:0:1" ||
- /^127\./.test(bare)
+ /^127(\.\d{1,3}){3}$/.test(bare)
) {
return "loopback";
}
diff --git a/server/tests/config.test.ts b/server/tests/config.test.ts
index 2fd6872a..d0398dd0 100644
--- a/server/tests/config.test.ts
+++ b/server/tests/config.test.ts
@@ -566,6 +566,23 @@ describe("deployment configuration", () => {
).toThrow("OPENBOT_SINGLE_USER");
});
+ // A name that merely starts with 127. is a public name, not loopback. Only a whole 127.x.x.x
+ // address is.
+ test.each([
+ [
+ "a public name starting 127.",
+ { OPENBOT_PUBLIC_URL: "https://127.example.com" },
+ ],
+ [
+ "a wildcard DNS name that starts 127.",
+ { TRUSTED_ORIGINS: "https://127.0.0.1.nip.io" },
+ ],
+ ])("refuses no sign-in on %s", (_label, published) => {
+ expect(() =>
+ loadConfig({ ...withoutSignIn, ...OPEN, ...published }),
+ ).toThrow("OPENBOT_SINGLE_USER");
+ });
+
// The local workflow the flag exists for, and the two addresses the quick start hands out.
test.each([
{},