mirror of
https://github.com/hansjone/netxops.git
synced 2026-10-09 05:10:45 +08:00
Harden alarm push auth and session export ZIP paths.
Ignore hub alarms before auth-ok, stop reconnecting after auth-fail, serialize sticky delivery with dispose on reset, and sanitize ZIP entry names against path traversal. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
92279c1220
commit
5598b3661c
5 changed files with 148 additions and 56 deletions
|
|
@ -7,8 +7,10 @@ import {
|
|||
sessionsExportZipFilename,
|
||||
} from '../src/netx/session-export.ts'
|
||||
|
||||
test('safePathSegment strips path separators and dots', () => {
|
||||
assert.equal(safePathSegment('../a/b'), '___a_b')
|
||||
test('safePathSegment strips path separators and keeps filename extensions', () => {
|
||||
assert.equal(safePathSegment('../a/b'), 'b')
|
||||
assert.equal(safePathSegment('..\\evil.jsonl'), 'evil.jsonl')
|
||||
assert.equal(safePathSegment('session.jsonl'), 'session.jsonl')
|
||||
assert.equal(safePathSegment('netxops-alarm-abc'), 'netxops-alarm-abc')
|
||||
})
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue