Skip to content

fix: restrict the developer boot context helper used by the POS and URY web - #241

Draft
esafwan wants to merge 1 commit into
developfrom
task/SweepSecurity-SEC-22-impl-1
Draft

fix: restrict the developer boot context helper used by the POS and URY web#241
esafwan wants to merge 1 commit into
developfrom
task/SweepSecurity-SEC-22-impl-1

Conversation

@esafwan

@esafwan esafwan commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

What it does / Summary

Restricts access to the get_context_for_dev API helper in ury/www/pos.py and ury/www/ury.py to authenticated users with the System Manager role.

What it solves / Motivation

  • Resolves security finding SEC-22 by closing an information leakage vulnerability where guest users could fetch full session boot context (get_boot()) when developer_mode was enabled.
  • Prevents unauthorized callers from accessing internal configuration and session boot data.

Key Technical Changes

  • ury/www/pos.py & ury/www/ury.py:
    • Removed allow_guest=True from @frappe.whitelist(methods=["POST"]).
    • Added access guard throwing frappe.PermissionError if frappe.session.user == "Guest" or "System Manager" is missing from the user's roles.

…anagers

Guests could retrieve full session boot data from the POS and URY dev
boot-context endpoints whenever developer_mode was enabled, because the
endpoints were whitelisted with allow_guest=True and gated only on
developer_mode. Drop allow_guest and require an authenticated user with
the System Manager role before returning boot data.
@esafwan esafwan changed the title Restrict the developer boot context helper used by the POS and URY web fix: restrict the developer boot context helper used by the POS and URY web Jul 21, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant