Skip to content

Don't follow symlinks when processing PCAP uploads #1137

Open

Description

@mmguero

Tracks the fix for GHSA-98jw-5wq7-6qjv:
https://github.com/cisagov/Malcolm/security/advisories/GHSA-98jw-5wq7-6qjv

The PCAP upload watcher (pcap-monitor/scripts/watch-pcap-uploads-folder.py)
runs as root and checks and changes ownership of new uploads by path, using
calls that follow symlinks. The upload directory is writable through the
upload service's SFTP server, which permits creating symlinks, so the
watcher should never follow a symlink when handling an upload.

Changes:

  • Inspect each upload with lstat() and remove symlinks and other
    non-regular entries instead of processing them
  • Open uploads with O_NOFOLLOW and perform the ownership change, file type
    detection, and size check through that file descriptor
  • Confirm the path still refers to the same file before moving or
    decompressing it
  • Read compressed uploads through the same descriptor, and set ownership and
    mode on the decompression temp file through its descriptor rather than by
    path

Uploads of regular PCAP, compressed PCAP, and archive files are processed
as before.

Activity

  1. added this to the v26.10.0 milestone on Oct 6, 2026
  2. self-assigned this
    on Oct 6, 2026
  3. added
    bugSomething isn't working
    uploadRelating to PCAP and/or Zeek log ingestion
    securityRelated to issues with bearing on the security of Malcolm itself
    on Oct 6, 2026
  4. added a commit that references this issue on Oct 6, 2026
    e9b9615
  5. added a commit that references this issue on Oct 20, 2026
    32bd60d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingsecurityRelated to issues with bearing on the security of Malcolm itselfuploadRelating to PCAP and/or Zeek log ingestion

Type

No type

Fields

No fields configured for issues without a type.

Projects

  • Status
    Testing

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions