particle-academy/prism-browser
Prism Browser is a Laravel package that provides a simple, browsable interface for Prism-powered content. Explore, preview, and navigate Prism items from your app with minimal setup, staying within familiar Laravel conventions. Ideal for quick inspection and demos.
Upgrade to v0.1.2 before relying on BrowserPolicy for any allow-list that can be influenced by untrusted input. This release is a security fix, not a feature release: shorthand, integer, octal, and hex IPv4 forms are now interpreted with inet_aton rules and refused when they resolve to non-public addresses.
Start by locating:
BrowserPolicy is configured and instantiated.A good first use case is a user-submitted URL that must match an allow-list before the application fetches or navigates to it. Add a regression test with 127.1, 0x7f000001, 2130706433, 0177.0.0.1, and 169.254.43518, and confirm they are treated as addresses and refused rather than accepted as hostnames.
Centralize allow-list handling behind BrowserPolicy rather than scattering string comparisons across controllers, jobs, and commands. Treat the policy as the single decision point before any outbound request or browser navigation.
Typical workflow:
BrowserPolicy.For Laravel applications, this usually means wrapping outbound HTTP calls in a small service or action class. Keep the policy call close to the request boundary so jobs, commands, and queued workflows cannot bypass it.
When allow-listing hosts from untrusted input, prefer explicit hostnames and exact matches. Do not assume a string is “just a name” because it looks unusual. Add test cases for:
127.10x7f00000121307064330177.0.0.1169.254.43518Also test that a name containing only digits remains a name, since v0.1.2 deliberately preserves that behavior.
v0.1.2 contains a security behavior change even though it is marked as non-breaking. If allow-listed hosts come from untrusted input, treat the upgrade as required.filter_var() or a simple regex for host validation.127.1, 0x7f000001, 2130706433, and 0177.0.0.1 all reach 127.0.0.1 in a browser. 169.254.43518 reaches the metadata endpoint.inet_aton rules, without DNS, and refused like other non-public addresses.BrowserPolicy, align it with the same address parsing rules or delegate to the package to avoid bypasses.How can I help you explore Laravel packages today?