Skip to content

Remove the github-pages gem dependency - #572

Merged
funnelfiasco merged 3 commits into
mainfrom
remove-github-pages-gem
Oct 27, 2026
Merged

funnelfiasco merged 3 commits into
mainfrom
remove-github-pages-gem

Conversation

@funnelfiasco

Copy link
Copy Markdown
Contributor

This gem has a path traversal vulnerability in a transitive dependency and appears to be abandoned, so it's unlikely that it'll get fixed. So instead, we'll just take it out of our dependency graph. This requires a few other changes:

  • Explicitly add frontmatter to md files that should get rendered
  • (thus edit existing files, templates, and the crosswalk generator)
  • Moving the scss file (easier than fighting the theme)

As an added bonus, it makes some of the implicit behavior more explicit and we don't need to handle certain links differently.

This gem has a path traversal vulnerability in a transitive dependency
and appears to be abandoned, so it's unlikely that it'll get fixed. So
instead, we'll just take it out of our dependency graph. This requires a
few other changes:

- Explicitly add frontmatter to md files that should get rendered
- (thus edit existing files, templates, and the crosswalk generator)
- Moving the scss file (easier than fighting the theme)

As an added bonus, it makes some of the implicit behavior more explicit
and we don't need to handle certain links differently.

Signed-off-by: Ben Cotton <bcotton@linuxfoundation.org>

@lehors lehors left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Nice! I wish I knew you were working on this. I just made a similar change to the AI Security Baseline and was going to submit one here.

For what it's worth I was told directly by GitHub support that they wouldn't change the github-pages gem because it would break too many sites so this is definitely the way to go.

@eddie-knight eddie-knight left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🤖 Multi-model AI review.

Verdict: needs changes. The site is not built from this Gemfile, so the vulnerable gem stays in production, and the theme switch drops the footer social links.

Do next

  1. Make docs/Gemfile the file that builds the site, or scope the description to the lockfile alert (inline, docs/Gemfile:6).
  2. Restore the footer social links (inline, docs/_config.yml:25).
  3. Re-add the plugins the site relied on (inline, docs/Gemfile:12).
  4. Loosen the jekyll-feed and jekyll-seo-tag constraints, or every build warns because the action's bundle check cannot satisfy them.
  5. Keep the <a href> checklist links (inline, docs/index.md:19).

Questions for the author

  1. Is the path traversal in the description Dependabot alert #26? Naming it there helps the next reader.
  2. Is the goal the lockfile alert, or changing what builds baseline.openssf.org? Item 1 depends on the answer.

Comment thread docs/Gemfile Outdated
Comment thread docs/_config.yml Outdated
Comment thread docs/Gemfile Outdated
Comment thread docs/index.md
@lehors

lehors commented Oct 23, 2026

Copy link
Copy Markdown

Oh, GitHub support recommended to me not using the jekyll-build-pages github action anymore and instead build the site directly using jekyll instead. It actually took me a few iterations to get it working but finally got it. You can see my updated version of web-publish.yml in the AI Security Baseline repo and if that helps I can submit the changes.

@funnelfiasco

Copy link
Copy Markdown
Contributor Author

Ugh, this LLM feedback is so damn verbose that it's going to take me longer to think through what it's saying than to fix the issues.

@eddie-knight

Copy link
Copy Markdown
Contributor

@funnelfiasco sorry for the misfire there. I had it set to give all of the relevant information required for a fix, which ended up being a lot here. Trying to tidy it up now.

- Footer
- FAQ rendering
- Other themey things

Note: I explicitly set the URL instead of deriving it from the GitHub
environment since that's the only place we'd use it and it doesn't seem
worth adding another dependency just for that.

Signed-off-by: Ben Cotton <bcotton@linuxfoundation.org>
@funnelfiasco
funnelfiasco marked this pull request as draft October 23, 2026 18:29
@funnelfiasco
funnelfiasco marked this pull request as ready for review October 23, 2026 18:31
Signed-off-by: Ben Cotton <bcotton@linuxfoundation.org>
@funnelfiasco

Copy link
Copy Markdown
Contributor Author

Okay, I think it's updated enough now. Thanks for the pointer @lehors!

@evankanderson evankanderson left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Trying to parse this without understanding of ruby, but a few comments about the removed dependencies.

My $0.02 is that the path traversal risk is silly for a static site generator, but I can understand not wanting to stand up a VEX pipeline to cancel this one complaint out.

with:
source: ./docs
destination: ./_site
run: cd docs && bundle exec jekyll build

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Do we want to use cd docs or --source ./docs? I feel like putting the built code inside the docs dir could cause problems on a (local) rebuild. (I know that I'd be likely to copy the command from here when building locally is why I ask.)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I think it's fine? It matches what the Makefile already does and we have docs/_site in .gitignore so I don't see any issues.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Oh, interesting! The docs/_site entry in gitignore wouldn't have been used previously.

Comment thread docs/Gemfile.lock
Comment thread docs/Gemfile.lock
Comment on lines -158 to -159
jekyll-optional-front-matter (0.3.2)
jekyll (>= 3.0, < 5.0)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If we include jekyll-optional-front-matter could we avoid needing to add a bunch of empty frontmatter to the .md files?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We could. However, I think this simplifies things for us by clearly distinguishing between "should be rendered as HTML" and "should be kept as a markdown file".

Comment thread docs/Gemfile.lock
Comment thread docs/Gemfile.lock
@funnelfiasco
funnelfiasco merged commit 530ab27 into main Oct 27, 2026
7 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.

4 participants