Skip to content

fix timeout for salt-api#62188

Open
carrysauce wants to merge 2 commits into
saltstack:masterfrom
carrysauce:fix-salt-api-auth
Open

fix timeout for salt-api#62188
carrysauce wants to merge 2 commits into
saltstack:masterfrom
carrysauce:fix-salt-api-auth

Conversation

@carrysauce

@carrysauce carrysauce commented Jun 17, 2022

Copy link
Copy Markdown

What does this PR do?

Move format_call under try block to protect from DDoS from bad requests without password or username fields.

What issues does this PR fix or reference?

Fixes: #62187

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

No

Please review Salt's Contributing Guide for best practices.

See GitHub's page on GPG signing for more information about signing commits with GPG.

@carrysauce carrysauce requested a review from a team as a code owner June 17, 2022 11:00
@carrysauce carrysauce requested review from ScriptAutomate and removed request for a team June 17, 2022 11:00
@welcome

welcome Bot commented Jun 17, 2022

Copy link
Copy Markdown

Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey.
Please be sure to review our Code of Conduct. Also, check out some of our community resources including:

There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar.
If you have additional questions, email us at saltproject@vmware.com. We’re glad you’ve joined our community and look forward to doing awesome things with you!

@twangboy twangboy 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.

Please add a changelog and a test

Comment thread salt/auth/__init__.py
try:
fcall = salt.utils.args.format_call(
self.auth[fstr], _load, expected_extra_kws=AUTH_INTERNAL_KEYWORDS
)

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.

Could you add this to its own Try/Except block with an appropriate debug message?

@twangboy twangboy added needs-testcase PR needs test cases written, or the issue is about a bug/feature that needs test cases needs-changelog test:full Run the full test suite labels Jul 3, 2025
@twangboy twangboy modified the milestones: Argon v3008.0, Argon v3008.1 Jun 5, 2026
@dwoz dwoz force-pushed the fix-salt-api-auth branch from 4e0b86b to 9da382e Compare June 10, 2026 00:14
dwoz pushed a commit to carrysauce/salt that referenced this pull request Jun 10, 2026
Addresses @twangboy's CHANGES_REQUESTED on PR saltstack#62188.

- changelog/62187.fixed.md describes the salt-api hang fix.
- test_mk_token_missing_password_returns_empty pins the missing-password
  /username path: mk_token must return {} instead of raising
  SaltInvocationError, which previously escaped through the master
  clear-payload handler and hung salt-api workers for ~3 minutes per
  bad request.

Co-authored-by: carrysauce <carrysauce@users.noreply.github.com>
@dwoz dwoz removed this from the Argon v3008.1 milestone Jun 10, 2026
dwoz pushed a commit to carrysauce/salt that referenced this pull request Jun 11, 2026
Addresses @twangboy's CHANGES_REQUESTED on PR saltstack#62188.

- changelog/62187.fixed.md describes the salt-api hang fix.
- test_mk_token_missing_password_returns_empty pins the missing-password
  /username path: mk_token must return {} instead of raising
  SaltInvocationError, which previously escaped through the master
  clear-payload handler and hung salt-api workers for ~3 minutes per
  bad request.

Co-authored-by: carrysauce <carrysauce@users.noreply.github.com>
@dwoz dwoz force-pushed the fix-salt-api-auth branch from 911dbd8 to 143af4b Compare June 11, 2026 04:13
Alex Donec and others added 2 commits June 15, 2026 15:35
Addresses @twangboy's CHANGES_REQUESTED on PR saltstack#62188.

- changelog/62187.fixed.md describes the salt-api hang fix.
- test_mk_token_missing_password_returns_empty pins the missing-password
  /username path: mk_token must return {} instead of raising
  SaltInvocationError, which previously escaped through the master
  clear-payload handler and hung salt-api workers for ~3 minutes per
  bad request.

Co-authored-by: carrysauce <carrysauce@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] salt-api server dies on bad /login request

3 participants