Repository navigation
Conversation
81reap
requested changes
Sep 23, 2026
Collaborator
There was a problem hiding this comment.
The Docker helper uses the older lovasoa/sqlpage:main image, which could not parse this checkout's SQL syntax.
are we sure about this, the main tag has a new image from 5 days ago? how is CI passing if it uses the docker image to test? maybe a stale local image, is there a way to force repull/upgrade?
also this is the same raw $path bug, no?
Comment on lines
+29
to
+47
| iif( | ||
| $path IS NOT NULL | ||
| AND length($path) > 0 | ||
| AND ( | ||
| (substr($path, 1, 1) = '/' AND substr($path, 2, 1) <> '/') | ||
| OR ( | ||
| (substr($path, 1, 1) GLOB '[A-Za-z0-9_]' | ||
| OR substr($path, 1, 2) = './' | ||
| OR substr($path, 1, 3) = '../') | ||
| AND instr($path, ':') = 0 | ||
| ) | ||
| ) | ||
| AND instr($path, char(92)) = 0 | ||
| AND instr($path, '%') = 0 | ||
| AND instr($path, char(0)) = 0 | ||
| AND ($path GLOB '*[' || char(1) || '-' || char(31) || char(127) || ']*') = 0, | ||
| $path, | ||
| '/' | ||
| ) AS link; |
Collaborator
There was a problem hiding this comment.
this and the duplicated copy in logout would be cleaner to read as a CASE statement https://www.w3schools.com/sql/sql_case.asp something like
set return_to = CASE
WHEN $path GLOB '*[' || char(1) || '-' || char(31) || char(127) || '%\]*' THEN NULL
WHEN instr($path, char(0)) > 0 THEN NULL
WHEN $path = '/' OR $path GLOB '/[^/]*' THEN $path
WHEN $path GLOB './*' OR $path GLOB '../*' THEN $path
WHEN $path GLOB '[A-Za-z0-9_]*' AND instr($path,':') = 0 THEN $path
END;| [Asserts] | ||
| header "Location" == "/login.sql?path=/currencies_list.sql" | ||
|
|
||
| POST http://localhost:8080/create_session.sql?path=https%3A%2F%2Fevil.example |
Collaborator
There was a problem hiding this comment.
testing for create is not as robust as logout. we should test the same edge cases here
lovasoa
marked this pull request as draft
September 24, 2026 19:27
lovasoa
force-pushed
the
codex/auth-example-safe-redirects
branch
from
September 27, 2026 06:49
21bdb18 to
73b496f
Compare
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 CRUD authentication example used the untrusted
pathquery parameter directly as a post-login or logout redirect. Crafted links could send users to an external site. The example now accepts local absolute and relative paths, including./and../, and falls back to a local page for unsafe values.The Hurl flow now exercises external, authority-relative, backslash, encoded, and valid relative targets. Both example READMEs document the rule.
Validation: 24 Hurl requests passed against the current locally built SQLPage binary. The Docker helper uses the older
lovasoa/sqlpage:mainimage, which could not parse this checkout's SQL syntax.