8000 Cookie CSRF · Issue #6953 · gogs/gogs · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Cookie CSRF #6953

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

Closed
1 task done
tsimmons opened this issue May 17, 2022 · 12 comments · Fixed by #6969
Closed
1 task done

Cookie CSRF #6953

tsimmons opened this issue May 17, 2022 · 12 comments · Fixed by #6969
Assignees
Labels
💊 bug Something isn't working 🐣 pull request welcome Welcome to contribute for this! 🔒 security Categorizes as related to security
Milestone

Comments

@tsimmons
Copy link

Gogs version

0.13.0+dev

Git version

  • Server: 2.17.1
  • Client: (not applicable)

Operating system

Ubuntu 18.04.6

Database

MySQL 5.7

Describe the bug

Security issue with malformed requests, submitted via email to security@gogs.io on May 17, 2022.

To reproduce

See email (will confirm once accepted.)

Expected behavior

See email (will confirm once accepted.)

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@tsimmons tsimmons added the 💊 bug Something isn't working label May 17, 2022
@unknwon
Copy link
Member
unknwon commented May 25, 2022

Hey! It doesn't seem like I've received the email 🤔 could you resend?

@unknwon unknwon added the status: needs feedback Tell me more about it label May 25, 2022
@tsimmons
Copy link
Author

I sent them to security@gogs.io ... just resent them.

8000

@unknwon
Copy link
Member
unknwon commented May 25, 2022

Thanks, got it now! For some reason (maybe due to the nature of the content 😂 ) it's in my spam folder and my email client doesn't show it, I had to go to the webmail from my provider to pull it out to the inbox.

@tsimmons
Copy link
Author

Good to hear. My patch works swell in my case.

@unknwon
Copy link
Member
unknwon commented May 25, 2022

Could you confirm if you have received my reply? 🤦‍♂️ my email client kept telling me it can't send.

In case it does not get sent:

I think the the fundamentals of the report is identical to https://www.huntr.dev/bounties/6f41ee81-038d-4acf-b101-27c698161a3d/, which IMO is nice to fix but no practical impact. Though if you already have a patch, we can see what we can do :)

@tsimmons
Copy link
Author
tsimmons commented May 25, 2022

I did not receive your email, but yes that is exactly the issue (sorry I missed it when creating this ticket.) It is 100% practical because PCI requirements cannot permit injected script into a webpage. If a malicious actor can inject script into a page in the context of a logged-in user, they can own the repo (in a nutshell.) My patch works and is simple to implement. From our PCI scanner, Gogs has a "Cross-site Scripting (XSS) vulnerability"

XSS vulnerabilities occur when the Web application echoes user-supplied data in an HTML response sent to the Web browser. For example, a Web application might include the user's name as part of a welcome message or display a home address when confirming a shipping destination. If the user-supplied data contain characters that are interpreted as part of an HTML element instead of literal text, then an attacker can modify the HTML that is received by the victim's Web browser.

Further reading

@unknwon
Copy link
Member
unknwon commented May 25, 2022

No worries on missing the huntr.dev report!

Please also read my comments on the above huntr.dev link, for why I think it is not practical to actually archive a realistic attack for what's been reported here. I'm not saying XSS isn't a thing.

@tsimmons
Copy link
Author

Yep, I read them. I will not construct a POC but knowing your application returns unsanitized user-input (even if it is a cookie header) which is an immediate PCI failure, we have patched our install. Again, the patch is simple and tiny. If you object to it, that is your prerogative.

@unknwon
Copy link
Member
unknwon commented May 25, 2022

I previously commented:

[...] nice to fix [...]. Though if you already have a patch, we can see what we can do :)

Just to rephrase the same thing, I definitely would not object to fix it and pull request is welcome!

@tsimmons
Copy link
Author

I emailed the diff, would you like an official PR? I can certainly do that if you like.

@unknwon unknwon added 🔒 security Categorizes as related to security 🐣 pull request welcome Welcome to contribute for this! and removed status: needs feedback Tell me more about it labels May 25, 2022
@unknwon
Copy link
Member
unknwon commented May 25, 2022

It would be ideal if you could propose the PR, I don't want to take the credit for the diff.

I'd also want to go through a proper code review 😁

@unknwon unknwon added this to the 0.12.8 milestone May 26, 2022
@unknwon unknwon moved this to In Progress in Gogs Roadmap May 26, 2022
@unknwon unknwon moved this from In Progress to QA / In Review in Gogs Roadmap May 26, 2022
@unknwon unknwon linked a pull request May 26, 2022 that will close this issue
3 tasks
Repository owner moved this from QA / In Review to Done in Gogs Roadmap May 26, 2022
@unknwon
Copy link
Member
unknwon commented May 31, 2022

The 0.12.8 has been released that includes the patch of the reported issue.

The security Advisory has been published at GHSA-pj96-4jhv-v792.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 30, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
💊 bug Something isn't working 🐣 pull request welcome Welcome to contribute for this! 🔒 security Categorizes as related to security
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants
0