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

Replace to gopkg.in/yaml with github.com/goccy/go-yaml (note) #13033

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

Conversation

bep
Copy link
Member

@bep bep commented Nov 13, 2024

Fixes #8822

@bep bep force-pushed the fix/goyaml-8822 branch 4 times, most recently from ecb0fa6 to 6a658a6 Compare November 14, 2024 19:12
@bep bep marked this pull request as ready for review November 14, 2024 19:12
@bep
Copy link
Member Author

bep commented Nov 15, 2024

@gohugoio gohugoio deleted a comment from Accuweaty24 Nov 30, 2024
@bep
Copy link
Member Author

bep commented Dec 15, 2024

With goccy/go-yaml#461 closed, I must also close this. For now, at least. I may revisit this if once I understand it better / find a workaround on Hugo's side. But re. Hugo's security policy, the templates are trusted, the content files are not. It's fairly common to print/marshal (e.g. jsonify) front matter values. So, even if the Go maps themselves isn't big, one could easily imagine the rendered output blow up with front matter constructs like the below:

---
title: Biiiig Front Matter
a: &a [_,_,_,_,_,_,_,_,_,_,_,_,_,_,_]
b: &b [*a,*a,*a,*a,*a,*a,*a,*a,*a,*a]
c: &c [*b,*b,*b,*b,*b,*b,*b,*b,*b,*b]
d: &d [*c,*c,*c,*c,*c,*c,*c,*c,*c,*c]
e: &e [*d,*d,*d,*d,*d,*d,*d,*d,*d,*d]
f: &f [*e,*e,*e,*e,*e,*e,*e,*e,*e,*e]
g: &g [*f,*f,*f,*f,*f,*f,*f,*f,*f,*f]
h: &h [*g,*g,*g,*g,*g,*g,*g,*g,*g,*g]
i: &i [*h,*h,*h,*h,*h,*h,*h,*h,*h,*h]
---

@bep bep closed this Dec 15, 2024
@bep
Copy link
Member Author

bep commented Dec 19, 2024

I'll reopen; I have worked with this library in another project, and having those anchors/aliases is really useful. I will try to figure out a way to detect these anomalies in the Go map.

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.

Replace to gopkg.in/yaml with github.com/goccy/go-yaml (slightly breaking change)
1 participant