mirror of
https://github.com/gogs/gogs.git
synced 2025-05-31 11:42:13 +00:00
SECURITY: HTML injection in user search API
Reported by Tim Hawes.
This commit is contained in:
parent
c1507eda45
commit
ea313d0c1e
@ -12,6 +12,7 @@ import (
|
|||||||
"github.com/gogits/gogs/models"
|
"github.com/gogits/gogs/models"
|
||||||
"github.com/gogits/gogs/models/errors"
|
"github.com/gogits/gogs/models/errors"
|
||||||
"github.com/gogits/gogs/pkg/context"
|
"github.com/gogits/gogs/pkg/context"
|
||||||
|
"github.com/gogits/gogs/pkg/markup"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Search(c *context.APIContext) {
|
func Search(c *context.APIContext) {
|
||||||
@ -39,7 +40,7 @@ func Search(c *context.APIContext) {
|
|||||||
ID: users[i].ID,
|
ID: users[i].ID,
|
||||||
UserName: users[i].Name,
|
UserName: users[i].Name,
|
||||||
AvatarUrl: users[i].AvatarLink(),
|
AvatarUrl: users[i].AvatarLink(),
|
||||||
FullName: users[i].FullName,
|
FullName: markup.Sanitize(users[i].FullName),
|
||||||
}
|
}
|
||||||
if c.IsLogged {
|
if c.IsLogged {
|
||||||
results[i].Email = users[i].Email
|
results[i].Email = users[i].Email
|
||||||
|
Loading…
x
Reference in New Issue
Block a user