Skip to content

Permissions reference

Path-bearing Bridge endpoints are validated by BridgeCore path-security specs before the handler body runs. Rejected requests return PERMISSION_DENIED and never reach the filesystem or foobar2000 SDK path side effects.

Authority counts are taken from current RegisterApi path-security specs of the form { param, SecurityLevel::... } in src/api/**:

LevelSpec countMeaning
Read9Ordinary filesystem read checks
Write1Strict write destinations (config/temp style policy)
MediaRead40Media-context read checks
MediaWrite17Media-context write checks
Total6764 unique APIs

Five-level model

LevelDescriptionValidation summary
NoneNo file-path parameterNo path validation
ReadRead-only filesystem operationsBlocks system protected directories, device paths, and .. traversal
WriteWrite destinations under the strict write policyAllowed only under foobar2000 profile / temp destinations enforced by PathSecurity
MediaReadMedia metadata/content readsRead rules plus media-library / playlist context trust
MediaWriteMedia mutation (tags, lyrics, artwork, counts)MediaRead rules plus write blacklist and no free non-system-drive bypass

Level relationships

None < Read < Write forms the ordinary filesystem channel. None < Read < MediaRead < MediaWrite forms the media channel. Write and MediaWrite are independent write channels.

Error response

json
{
  "success": false,
  "error": "Path rejected by security policy: C:\\Windows\\System32\\config.ini",
  "code": "PERMISSION_DENIED"
}
javascript
const result = await fb2k.invoke('file.read', { path: somePath });
if (!result.success && result.code === 'PERMISSION_DENIED') {
  console.warn('Path rejected by security policy:', result.error);
}

API permission matrix

Read — filesystem read (9 specs)

APIParameterArrayNested keyNotes
artwork.getFolderImagesdirectoryRuntime authority: ArtworkApi.cpp
clipboard.writeFilespathsyesRuntime authority: ClipboardApi.cpp
file.copysourceRuntime authority: FileApi.cpp
file.existspathRuntime authority: FileApi.cpp
file.getInfopathRuntime authority: FileApi.cpp
file.listpathRuntime authority: FileApi.cpp
file.readpathRuntime authority: FileApi.cpp
shell.openWithpathRuntime authority: ShellApi.cpp
shell.showInExplorerpathRuntime authority: ShellApi.cpp

Write — strict write destinations (1 specs)

APIParameterArrayNested keyNotes
http.downloadsaveToRuntime authority: HttpApi.cpp

MediaRead — media reads (40 specs)

APIParameterArrayNested keyNotes
artwork.getAvailableArtworkpathRuntime authority: ArtworkApi.cpp
artwork.getAvailableTypespathRuntime authority: ArtworkApi.cpp
artwork.getBatchpathsyesRuntime authority: ArtworkApi.cpp
artwork.getByPathpathRuntime authority: ArtworkApi.cpp
artwork.getFb2kUrlByPathpathRuntime authority: ArtworkApi.cpp
artwork.getFb2kUrlByPathBatchitemsyespathRuntime authority: ArtworkApi.cpp
artwork.getFb2kUrlByPathBatchpathsyesRuntime authority: ArtworkApi.cpp
artwork.getForTrackpathRuntime authority: ArtworkApi.cpp
artwork.getLyricspathRuntime authority: ArtworkApi.cpp
artwork.getMetadatapathRuntime authority: ArtworkApi.cpp
audio.analyzeBPMpathRuntime authority: AudioApi.cpp
audio.generateFullWaveformpathRuntime authority: AudioApi.cpp
audio.generateWaveformpathRuntime authority: AudioApi.cpp
discovery.executeContextMenuByPathtrackPathRuntime authority: DiscoveryApi.cpp
jitQueue.enqueueNexturlRuntime authority: QueueApi.cpp
jitQueue.playNowurlRuntime authority: QueueApi.cpp
jitQueue.preloadBatchurlsyesRuntime authority: QueueApi.cpp
library.getByPathpathRuntime authority: LibraryApi.cpp
lyrics.existspathRuntime authority: LyricsApi.cpp
lyrics.getpathRuntime authority: LyricsApi.cpp
metadata.readpathRuntime authority: MetadataApi.cpp
metadata.readBatchpathsyesRuntime authority: MetadataApi.cpp
metadata.readByPathpathRuntime authority: MetadataApi.cpp
metadata.readRawpathRuntime authority: MetadataApi.cpp
playback.playPathpathRuntime authority: PlaybackApi.cpp
playback.playPathspathsyesRuntime authority: PlaybackApi.cpp
playcount.getpathsyesRuntime authority: PlaycountApi.cpp
playcount.getBatchpathsyesRuntime authority: PlaycountApi.cpp
playlist.addPathspathsyesRuntime authority: PlaylistApi.cpp
playlist.addPathsAsyncpathsyesRuntime authority: PlaylistApi.cpp
playlist.addPathsSequentialpathsyesRuntime authority: PlaylistApi.cpp
playlist.replaceAllAndPlaypathsyesRuntime authority: PlaylistApi.cpp
queue.addPathspathsyesRuntime authority: QueueApi.cpp
rating.getpathRuntime authority: MetadataApi.cpp
replaygain.getpathsyesRuntime authority: ReplayGainApi.cpp
replaygain.scanpathsyesRuntime authority: ReplayGainApi.cpp
titleformat.evalpathRuntime authority: TitleformatApi.cpp
titleformat.evalBatchpathsyesRuntime authority: TitleformatApi.cpp
titleformat.evalFieldspathRuntime authority: TitleformatApi.cpp
titleformat.evalFieldsBatchpathsyesRuntime authority: TitleformatApi.cpp

MediaWrite — media mutation (17 specs)

APIParameterArrayNested keyNotes
file.copydestinationRuntime authority: FileApi.cpp
file.deletepathRuntime authority: FileApi.cpp
file.mkdirpathRuntime authority: FileApi.cpp
file.movedestinationRuntime authority: FileApi.cpp
file.movesourceRuntime authority: FileApi.cpp
file.renamepathRuntime authority: FileApi.cpp
file.writepathRuntime authority: FileApi.cpp
lyrics.savepathRuntime authority: LyricsApi.cpp
metadata.embedArtworkpathRuntime authority: MetadataApi.cpp
metadata.removeEmbeddedArtpathRuntime authority: MetadataApi.cpp
metadata.removeFieldpathRuntime authority: MetadataApi.cpp
metadata.removeTagpathRuntime authority: MetadataApi.cpp
metadata.writepathRuntime authority: MetadataApi.cpp
metadata.writeBatchitemsyespathRuntime authority: MetadataApi.cpp
playcount.setpathRuntime authority: PlaycountApi.cpp
rating.setpathRuntime authority: MetadataApi.cpp
replaygain.clearpathsyesRuntime authority: ReplayGainApi.cpp

Nested array validation

metadata.writeBatch validates each object in items by reading the nested path key.

Custom / non-decorator policy

These endpoints manage their own policy outside ordinary decorator specs:

APIPolicy notes
shell.execNo executable whitelist; optional cwd still goes through PathSecurity
shell.spawnNo executable whitelist; absolute executable path and cwd are path-checked
console.logLog directory restriction, reserved device names, and .log / .txt extension allowlist
playlist.insertTracksOperates on playlist handles rather than raw filesystem paths

Path security details

Common rejections

  • Device paths: \\.\... and \\?\...
  • Directory traversal containing ..
  • Empty or relative paths (absolute paths required)

Read

System-drive protected directories include:

DirectoryReason
C:\\Windows\\OS files
C:\\Program Files\\Installed programs
C:\\Program Files (x86)\\32-bit programs
C:\\ProgramData\\System configuration data

Non-system drives are generally allowed for portable / NAS media workflows under Read.

Write

Only destinations accepted by the strict write policy succeed. In practice this is the foobar2000 profile directory and the system temporary directory.

MediaRead

In addition to Read rules, the target must resolve into:

  • the foobar2000 media library, or
  • any playlist item (playlist scan is bounded by the runtime implementation).

MediaWrite

In addition to MediaRead:

  • system-protected directories remain blocked even if the item appears in a library/playlist context
  • non-system-drive automatic bypass is not applied

Counts summary

LevelSpecsUnique APIs in this level table
Read99
Write11
MediaRead4039
MediaWrite1716
Total6764

These counts are regenerated from the C++ RegisterApi path-security specs in the component source.