Skip to content

VIBECODED fix voor #164#181

Merged
seanscodes merged 4 commits intopolarnl:stablefrom
SSoggyTacoMan:stable
Mar 9, 2026
Merged

VIBECODED fix voor #164#181
seanscodes merged 4 commits intopolarnl:stablefrom
SSoggyTacoMan:stable

Conversation

@SSoggyTacoMan
Copy link
Collaborator

This pull request makes minor adjustments to improve file handling and security checks in the codebase. The changes focus on updating file extension matching and expanding the list of blocked redirect paths.

Improvements to file handling:

  • Updated the file extension matching in src/proxy.ts to include .json files, ensuring that requests for JSON files are properly handled or filtered.

Security enhancements:

  • Added /manifest.json to the list of blocked redirect paths in src/utils/auth/redirect.ts to prevent potential security issues with redirects to this file.

Claude AI and others added 4 commits March 9, 2026 16:18
- Add .json to static file bypass regex to prevent manifest.json from entering auth middleware
- Add /manifest.json to blockedPaths to prevent redirect to manifest after login
- Fixes issue polarnl#164 where Safari/WebKit users were redirected to manifest.json after login

Co-authored-by: SSoggyTacoMan <80040706+SSoggyTacoMan@users.noreply.github.com>
Co-authored-by: SSoggyTacoMan <80040706+SSoggyTacoMan@users.noreply.github.com>
@SSoggyTacoMan SSoggyTacoMan requested review from Jvr2022, andr3i1010 and supersiem and removed request for andr3i1010 March 9, 2026 16:46
@SSoggyTacoMan SSoggyTacoMan linked an issue Mar 9, 2026 that may be closed by this pull request
@SSoggyTacoMan SSoggyTacoMan marked this pull request as draft March 9, 2026 16:48
@SSoggyTacoMan SSoggyTacoMan requested a review from Copilot March 9, 2026 17:08
@SSoggyTacoMan SSoggyTacoMan marked this pull request as ready for review March 9, 2026 17:09
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts request handling and redirect validation to better handle JSON-related paths and reduce unsafe redirect targets.

Changes:

  • Extends static-file path matching in proxy to treat *.json as skippable.
  • Expands the redirect blacklist to prevent redirects to /manifest.json.
  • Adds // AI CODE START/END markers around the modified lines.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 4 comments.

File Description
src/utils/auth/redirect.ts Adds /manifest.json to the redirect blacklist.
src/proxy.ts Updates the static-asset extension regex to include json, causing JSON paths to bypass middleware logic.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines +15 to +16
// AI CODE START
/\.(css|js|ts|tsx|jsx|woff2?|ttf|png|jpg|jpeg|gif|svg|webmanifest|json)$/.test(pathname) ||
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding json to the “static files” extension allowlist means any *.json request will bypass the bot/scanner detection and the auth gate below. If the intent is only to let /manifest.json through, it would be safer to special-case that path (or narrowly whitelist known public JSON assets) rather than exempting all JSON paths.

Suggested change
// AI CODE START
/\.(css|js|ts|tsx|jsx|woff2?|ttf|png|jpg|jpeg|gif|svg|webmanifest|json)$/.test(pathname) ||
pathname === "/manifest.json" ||
// AI CODE START
/\.(css|js|ts|tsx|jsx|woff2?|ttf|png|jpg|jpeg|gif|svg|webmanifest)$/.test(pathname) ||

Copilot uses AI. Check for mistakes.
Comment on lines +31 to 33
const blockedPaths = ['/api/', '/auth/sign-out', '/manifest.json'];
// AI CODE END
if (blockedPaths.some(blocked => path.startsWith(blocked))) {
Copy link

Copilot AI Mar 9, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

blockedPaths is recreated on every call to getValidRedirectPath. Since it’s a static blacklist, consider moving it to module scope (or making it const outside the function) to avoid repeated allocations and keep the function focused on validation logic.

Copilot uses AI. Check for mistakes.
Copy link
Member

@supersiem supersiem left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm

@SSoggyTacoMan
Copy link
Collaborator Author

@supersiem zijn de comments van copilot nog goed om wat mee te doen? ik merge trouwens pas als @Jvr2022 security check doet wsant hij is mr hacker

@seanscodes seanscodes merged commit b3b810d into polarnl:stable Mar 9, 2026
4 of 5 checks passed
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.

[BUG] Login naar manifest.json op IOS

5 participants