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

Repository description not escaped #8717

Closed
2 of 7 tasks
yasuokav opened this issue Oct 28, 2019 · 3 comments
Closed
2 of 7 tasks

Repository description not escaped #8717

yasuokav opened this issue Oct 28, 2019 · 3 comments

Comments

@yasuokav
Copy link
Contributor

Description

Related: #3903

Screenshots

3
4

@6543
Copy link
Member

6543 commented Oct 28, 2019

@zeripath
Copy link
Contributor

gitea/models/repo.go

Lines 831 to 839 in e3875ac

// DescriptionHTML does special handles to description and return HTML string.
func (repo *Repository) DescriptionHTML() template.HTML {
desc, err := markup.RenderDescriptionHTML([]byte(repo.Description), repo.HTMLURL(), repo.ComposeMetas())
if err != nil {
log.Error("Failed to render description for %s (ID: %d): %v", repo.Name, repo.ID, err)
return template.HTML(markup.Sanitize(repo.Description))
}
return template.HTML(markup.Sanitize(string(desc)))
}

The HTML is sanitised preventing any security issue. It is escaped.

@6543
Copy link
Member

6543 commented Oct 28, 2019

done at #6306

@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants