Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(nonce): override user-defined nonce values with Nuxt Image #593

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

GalacticHypernova
Copy link
Contributor

Resolves #586

Types of changes

  • Bug fix (a non-breaking change which fixes an issue)
  • New feature (a non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

For users utilizing Nuxt Image (with its option to provide custom nonces), Nuxt Security will override the user-defined nonce to ensure standard-complying, cryptographically secure nonces.

As a side note, it is worth deprecating the nonce property in Nuxt Image regardless due to the security concerns it brings with no proportionate benefit

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes (if not applicable, please state why)

Copy link

vercel bot commented Dec 28, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
security ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 28, 2024 5:36pm

@GalacticHypernova
Copy link
Contributor Author

GalacticHypernova commented Dec 28, 2024

I originally thought about making the nonce detection directly within the link regex, but I couldn't find as of this moment a pattern that is not susceptible to a ReDoS (regular expression denial of service) attack. Therefore, I introduced a new regex to compare for each found link.

@vejja
Copy link
Collaborator

vejja commented Dec 30, 2024

This one looks ok to me

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.

fix(nonce): duplication
2 participants