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

Bump ViewComponent to v3.9.0 #492

Merged
merged 3 commits into from
Jan 5, 2024

Conversation

benilovj
Copy link
Contributor

@benilovj benilovj commented Jan 5, 2024

This addresses an XSS vector ViewComponent/view_component#1950

Copy link

netlify bot commented Jan 5, 2024

Deploy Preview for govuk-components ready!

Name Link
🔨 Latest commit eef1e42
🔍 Latest deploy log https://app.netlify.com/sites/govuk-components/deploys/6597efb938b6b20008aca1eb
😎 Deploy Preview https://deploy-preview-492--govuk-components.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@benilovj
Copy link
Contributor Author

benilovj commented Jan 5, 2024

@peteryates

This is in response to GHSA-wf2x-8w6j-qw37

My commit includes hacks to get the specs to pass to potentially save you some time, but I'm not sure it's the right way to actually fix the underlying breakages. Happy to take your steer or if to close the PR if you want to do it yourself.

@benilovj benilovj force-pushed the bump-to-view_component-3.9.0 branch from 325eb3d to 984cd31 Compare January 5, 2024 11:46
@benilovj
Copy link
Contributor Author

benilovj commented Jan 5, 2024

I'm also seeing warnings in the RSpec run:

.........................................................................................................................................................................................................................................................................................................................................................................................................................................WARNING: The GovukComponent::TabComponent::Tab component rendered HTML-unsafe output. The output will be automatically escaped, but you may want to investigate.
WARNING: The GovukComponent::TabComponent::Tab component rendered HTML-unsafe output. The output will be automatically escaped, but you may want to investigate.
WARNING: The GovukComponent::TabComponent::Tab component rendered HTML-unsafe output. The output will be automatically escaped, but you may want to investigate.
...................................................................................................................................................................................................................................................................................................................................

I dunno if they've been introduced by this bump?

@peteryates
Copy link
Member

They have, just tracking them down now.

@peteryates
Copy link
Member

Those warnings can be fixed with:

diff --git a/app/components/govuk_component/tab_component.rb b/app/components/govuk_component/tab_component.rb
index 1ac03dd..8dc2250 100644
--- a/app/components/govuk_component/tab_component.rb
+++ b/app/components/govuk_component/tab_component.rb
@@ -23,7 +23,7 @@ private

     def initialize(label:, text: nil, classes: [], html_attributes: {})
       @label = label
-      @text  = text
+      @text  = h(text)

       super(classes: classes, html_attributes: html_attributes)
     end

Happy with the changes, once the above is in I'll get it merged and a release ready 🙂 Thanks @benilovj

This silences the warning:

WARNING: The GovukComponent::TabComponent::Tab component rendered HTML-unsafe output. The output will be automatically escaped, but you may want to investigate.
@benilovj benilovj marked this pull request as ready for review January 5, 2024 12:02
@peteryates peteryates added this pull request to the merge queue Jan 5, 2024
Merged via the queue into x-govuk:main with commit 1d7c7b6 Jan 5, 2024
12 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.

2 participants