Skip to content

Enhance DELETE Payload Sanitization in API Handler #3188

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

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

Conversation

HackedRico
Copy link

@HackedRico HackedRico commented Jul 9, 2025

Description

Additional checks to ensure proper sanitization of filenames and paths for DELETE request.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Tested different curl requests against CALDERA payload handler to ensure proper sanitization of filenames and DELETE functionality. In this testing, CALDERA v5.3.0 was used.

Examples:
(would require getting API session Cookie for test cases)

Should Work

curl -k -X DELETE \
    -H "Cookie: API_SESSION=$COOKIE" \
    'http://127.0.0.1:8888/api/v2/payloads/something.txt'

Expected Failure

curl -k -X DELETE \
    -H "Cookie: API_SESSION=$COOKIE" \
    'http://127.0.0.1:8888/api/v2/payloads/../../LICENSE'

This request escapes out of data/payloads directory which is a prohibited path traversal.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code

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.

1 participant