T09 · Insecure Skill Coding Practices
Warning
- Location
scripts/upnote.sh:59- Finding
Custom URL Query Parameter Injection Through Unencoded User Input
- Content
View full analysis
[true|false]" exit 1 fi open "upnote://x-callback-url/openNote?noteId=$NOTE_ID&new_window=$NEW_WINDOW" ;; ``` ```bash open) shift NOTEBOOK_ID="$1" if [[ -z "$NOTEBOOK_ID" ]]; then echo "Usage: upnote notebook open " exit 1 fi open "upnote://x-callback-url/openNotebook?notebookId=$NOTEBOOK_ID" ;; ``` ```bash filter) shift FILTER_ID="$1" if [[ -z "$FILTER_ID" ]]; then echo "Usage: upnote filter " exit 1 fi open "upnote://x-callback-url/openFilter?filterId=$FILTER_ID" ;; ``` ```bash view) shift MODE="$1" URL="upnote://x-callback-url/view?mode=$MODE" shift while [[ $# -gt 0 ]]; do case $1 in --note-id) URL+="¬eId=$2"; shift 2 ;; --notebook-id) URL+="¬ebookId=$2"; shift 2 ;; --tag-id) URL+="&tagId=$2"; shift 2 ;; --filter-id) URL+="&filterId=$2"; shift 2 ;; --space-id) URL+="&spaceId=$2"; shift 2 ;; --query) URL+="&action=search&query=$(urlencode "$2")"; shift 2 ;; *) echo "Unknown option: $1"; exit 1 ;; esac done open "$URL" ;; ``` ### Technical Analysis The script constructs `upnote://x-callback-url` URLs by directly concatenating several user-controlled values into the query string. The affected values include: - Note IDs - Notebook IDs - Filter IDs - Tag IDs - Space IDs - View modes - The `new_window` argument Unlike note titles, note content, notebook names, tag names, and search queries, the ...[truncated 2776 chars]- Remediation
View remediation
