fix: reject percent-encoded showStudypad/showImage in D-Bus reference#1339
Merged
karlkleinpaste merged 1 commit intoJul 1, 2026
Merged
Conversation
The substring denylist in ipc_object_set_current_reference() runs against the raw reference bytes before main_url_handler parses the URL. libsword's URL::getParameterValue percent-decodes the action parameter, so a reference like 'passagestudy.jsp?action=show%53tudypad' (or show%49mage for showImage) contains no literal 'showStudypad'/'showImage' substring, slips past the denylist, and dispatches the local-file action against the Xiphos user. Replace the substring denylist with a percent-decoding of the action parameter and a direct string compare against the blocked actions. The substring allowlist (must contain sword://, bible://, passagestudy.jsp, or xiphos.url) is kept as a fast pre-filter.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The substring denylist in
ipc_object_set_current_reference()runs against the raw reference bytes. A D-Bus peer on the user's session bus can send a reference likepassagestudy.jsp?action=show%53tudypad; libsword'sURL::getParameterValuepercent-decodes the action beforemain_url_handlerdispatches it, so the literal"showStudypad"substring is never seen by the denylist. The same works forshow%49mage(showImage). Both actions reach the local filesystem (load an arbitrary cwd file into the StudyPad editor; hand a path to xdg-open / ShellExecuteW after a bypassable suffix check).Replace the substring denylist with a percent-decoding of the
action=parameter and a directstrcmpagainst the blocked actions. The substring allowlist (must containsword://,bible://,passagestudy.jsp, orxiphos.url) is kept as a fast pre-filter.A self-contained reproducer is in
poc/reproducer.cin this branch: it demonstrates that apassagestudy.jsp?action=show%53tudypadreference is accepted by the old denylist and the action decodes toshowStudypadfor the switch inmain_url_handler.Follow-up to #1331.