Menu

#1 FreeSWITCH read-only gate: replace destructive-verb deny list with a subcommand allow list

open
nobody
None
2026-08-10
2026-08-10
Anonymous
No

Originally created by: tahiralmas

checkFreeswitchCommand in src/config.ts clears the first word against FREESWITCH_READ_COMMANDS, then rejects the line only if one of its words appears in DESTRUCTIVE_HINTS. A deny list of verbs only catches what was thought of at the time, so several write operations pass as read-only:

  • conference 3001 kick allconference is on the read list (because conference X list is useful) and kick is not in DESTRUCTIVE_HINTS.
  • Various fsctl subcommands, e.g. fsctl pause. fsctl shutdown happens to be caught because shutdown is on the deny list; pause is not.
  • db is on the read list; db insert is not caught either (delete and put are, insert is not).

The commands where the first word is not the whole story need a per-command allow list of subcommands rather than a global deny list of scary words. Something like:

conference: allow only `list`, `xml_list`
fsctl:      allow only `debug_level`, `sps`, `max_sessions` (read forms)
sofia:      allow only `status`, `xmlstatus`
db:         allow only `select`, `exists`

Anything not on the subcommand list falls through to needing PBX_MCP_ALLOW_WRITE=true, same as today.

The Asterisk side matches on command prefix, which does not have this problem in the same way, but it is worth a second look while this is open.

Raised by a commenter on the r/mcp thread: https://old.reddit.com/r/mcp/comments/1vkatsb/

Discussion


Log in to post a comment.