Exploit database

GH-562a516151f045835c0ee477b90de486

barrersoftware/opencode-secure

GitHubNot listedPoC
Download repository ZIP

Sources for CVE-2026-22812

6 sources

Preferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source

Repository files10
barrersoftware/opencode-secureRevision 806a6c7399a1

Files from this repository share one source choice. Supporting files may cover other vulnerabilities.

packages/util/src/path.ts

TypeScript · 532 bytes
export function getFilename(path: string | undefined) {
  if (!path) return ""
  const trimmed = path.replace(/[\/\\]+$/, "")
  const parts = trimmed.split(/[\/\\]/)
  return parts[parts.length - 1] ?? ""
}

export function getDirectory(path: string | undefined) {
  if (!path) return ""
  const parts = path.split("/")
  return parts.slice(0, parts.length - 1).join("/") + "/"
}

export function getFileExtension(path: string | undefined) {
  if (!path) return ""
  const parts = path.split(".")
  return parts[parts.length - 1]
}