Skip to content

armgit / ARTEX

Public Imported from GitHub
0

ARTEX - AI autonomous penetration testing system (English translation; upstream: Autumn-27/ARTEX, AGPL-3.0)

Merge remote-tracking branch 'origin/main' into pr465

BaaRai5df46e22c1b7
diff --cc CHANGELOG.md
index ed0db96,837cdfc..4e357ad
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@@ -6,7 -6,12 +6,13 @@@ All notable changes to this project ar
### Fixed
+ - **Live log subscribers can no longer crash the process**: a client disconnect closes its log channel. The sink now delivers a line while it still holds the subscriber lock, so that close cannot land in the middle of the send.
+ - **Notification delivery ignores HTTP_PROXY**: the dial guard checks the address it connects to. An environment proxy made that address the proxy, so a link-local target could still be reached. Notification HTTP now connects directly.
+ - **Captured traffic blobs are owner-only**: HTTP and raw-stream bodies spilled out of the database are written `0600`, and their bucket directory is `0700`. An existing blob is tightened when it is seen again.
+ - **Asset URLs drop userinfo when parsing fails**: a URL `url.Parse` rejects is no longer stored unchanged. The `scheme://userinfo@` prefix is removed first, so a password in that prefix does not land in the asset row.
+ - **Hook `range` counts against the memory budget**: ranging over a body, slice, string, or map charges the iteration before the loop. A body larger than the hook budget now stops with the memory limit instead of allocating one element at a time with no check.
+ - **Chat upload name search stops**: choosing `name`, `name-1`, `name-2`, … now returns an error when the filesystem rejects the path or after 10000 collisions, instead of looping while `Stat` keeps failing.
+- **Uploads do not follow a symlink**: chat and workspace uploads `Lstat` the destination and refuse to write when it is already a symlink. A dangling link is no longer treated as a free name.
- **Docker Compose database passwords with URL-special characters**: `docker-compose.yml` no longer pastes `POSTGRES_PASSWORD` into `ARTEX_PG_DSN`. The server builds the URL from `ARTEX_PG_HOST`, `ARTEX_PG_PORT`, `ARTEX_PG_USER`, `ARTEX_PG_PASSWORD`, `ARTEX_PG_DBNAME` and `ARTEX_PG_SSLMODE`, percent-encoding the user and password, so `/`, `?`, `%`, `@`, `:` and spaces connect. An explicit `ARTEX_PG_DSN` still wins and is not rewritten. `ARTEX_PG_PASSWORD` is removed from the environment with the other startup secrets (#450).
## [0.7.0] - 2026-11-21
diff --cc server/chatupload.go
index de9edea,b9ae457..e2cc5ba
--- a/server/chatupload.go
+++ b/server/chatupload.go
@@@ -143,12 -150,27 +150,28 @@@ func uniqueUploadPath(dir, name string
}
ext := filepath.Ext(name)
stem := strings.TrimSuffix(name, ext)
- for i := 1; ; i++ {
+ for i := 1; i <= maxUploadNameTries; i++ {
cand := filepath.Join(dir, fmt.Sprintf("%s-%d%s", stem, i, ext))
- if _, err := os.Lstat(cand); os.IsNotExist(err) {
- return cand
+ dest, ok, err := uploadPathFree(cand)
+ if err != nil || ok {
+ return dest, err
}
}
+ return "", fmt.Errorf("no free name for upload %q", name)
+ }
+
+ // uploadPathFree reports whether path can be created. ok is false when a file
-// is already there. Any other Stat error is returned so the caller stops.
++// or a symlink (including a dangling one) is already there. Any other Lstat
++// error is returned so the caller stops.
+ func uploadPathFree(path string) (dest string, ok bool, err error) {
- _, err = os.Stat(path)
++ _, err = os.Lstat(path)
+ if errors.Is(err, os.ErrNotExist) {
+ return path, true, nil
+ }
+ if err != nil {
+ return "", false, err
+ }
+ return "", false, nil
}
// composeAgentMessage appends an attachment manifest to the user's message so the agent