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

12.1.1 is not reasonable #1384

Closed
jmanico opened this issue Sep 28, 2022 · 20 comments · Fixed by #1514
Closed

12.1.1 is not reasonable #1384

jmanico opened this issue Sep 28, 2022 · 20 comments · Fixed by #1514
Labels
6) PR awaiting review _5.0 - prep This needs to be addressed to prepare 5.0

Comments

@jmanico
Copy link
Member

jmanico commented Sep 28, 2022

From https://github.com/OWASP/ASVS/blob/master/5.0/en/0x20-V12-Files-Resources.md

Most all providers allow large file uploads. This one needs to be dropped or revisited.

12.1.1 Verify that the application will not accept large files that could fill up storage or cause a denial of service. 400
@elarlang
Copy link
Collaborator

You can drop "large files" or reword it, but the point should stay - one user should not occupy entire storage space.

@jmanico
Copy link
Member Author

jmanico commented Sep 29, 2022

You can drop "large files" or reword it, but the point should stay - one user should not occupy entire storage space.

This is less of a problem with the cloud, and proper quota and quota is handled elsewhere. This is not a reasonable requirement and is too general and should, IMO, go away.

@elarlang
Copy link
Collaborator

As I have proved this to be an issue during pen-test cases and caused DoS attack with filled storage, I disagree and say - it is actual and valid requirement. Not everything in the world is/or will be moved to cloud.

And it is valid in cloud as well - there is auto-scale available for make more storage space available, but you need to pay for that (but this is more business logical issue).

@jmanico
Copy link
Member Author

jmanico commented Sep 29, 2022

So what size is too big? Many services take giant multi-GB files. I again assert the problem is that you abused quota and filled space to the max in your test and that the file size itself was not the problem.

We NEED to support large files as developers, which is also my point.

@jmanico
Copy link
Member Author

jmanico commented Sep 29, 2022

12.1.3 already talks about a file size quota. So there you go, you get your requirement. "large files" is ambiguous while "file size quota" is more relevant and covers your exact test case.

So again, I suggest we drop 12.1.1 since it's already COMPLETELY covered in 12.1.3

From https://github.com/OWASP/ASVS/blob/master/5.0/en/0x20-V12-Files-Resources.md

12.1.3 Verify that a file size quota and maximum number of files per user is enforced to ensure that a single user cannot fill up the storage with too many files, or excessively large files.   770

@elarlang
Copy link
Collaborator

elarlang commented Sep 29, 2022

Agree with those arguments on storage topic, those are covered with 12.1.3 and this part should be removed from 12.1.1 if the requirement itself stays.

But I want to be sure that we don't create some new not covered area here.

12.1.1 without storage occupation should be:
Verify that the application will not accept large files that could cause a denial of service. (+ in general application is not able to process).

If some application or service accepts "too large" file and dies when processing it, it is "a bit" problematic. I think we need to cover that case. It's basically userinput validation. It's a bit the same, like do not accept longer text-field values you can store to the database field.

One more thing to take in account or think through - current logic behind ZIP bomb's is a bit related that you don't allow to upload "too large" compressed files.
#799 (comment)

@jsulinski
Copy link
Contributor

jsulinski commented Sep 29, 2022

Another idea here would be dropping 12.1.1 and modifying 12.1.3 to read:

"Verify that file size and number restrictions are enforced per user to ensure that a single user cannot fill up storage or cause a denial of service."

It also might make sense to include this in L1 as it can be tested externally and is included in most pentests.

@elarlang
Copy link
Collaborator

I would keep storage and denial of service topics separately

@elarlang elarlang self-assigned this Sep 30, 2022
@elarlang elarlang added the 3) awaiting proposal There is some discussion in issue and reach to some results but it's not concluded with clear propos label Oct 7, 2022
@danielcuthbert
Copy link
Collaborator

Whilst we have changed how we feel about size, the requirement is still valid and if you do say accept 1gb uploads, they need to handled and processed in a way that doesn't kill the app or turn into a dos-like attack.

For example, what @jsulinski wrote is ideal

@elarlang
Copy link
Collaborator

elarlang commented Oct 8, 2022

I repeat, that for me it makes sense to keep those requirements separately

  • 12.1.1 - test per one file, mostly doable with black-box testing, checks the application per one file upload
  • 12.1.3 - is checking available resources from the configuration/setup and if you can not cause immediate damage/dos, it requires white-box testing.

And at the moment I would just remove the storage problem from 12.1.1
Verify that the application will not accept large files that could cause a denial of service.

Or just improve this requirement with the message, that application can accept however large files, but it must be able to handle/process them.

@tghosth tghosth assigned tghosth and unassigned jmanico Dec 7, 2022
@tghosth tghosth added _5.0 - prep This needs to be addressed to prepare 5.0 josh/elar labels Dec 7, 2022
@tghosth
Copy link
Collaborator

tghosth commented Dec 28, 2022

12.1.1 needs to be focussed 100% on the risk of denial of service at processing time, not at storage time.

@set-reminder 3 weeks @tghosth to create a PR

@octo-reminder
Copy link

octo-reminder bot commented Dec 28, 2022

Reminder
Wednesday, January 18, 2023 12:00 AM (GMT+01:00)

@tghosth to create a PR

@tghosth tghosth removed the josh/elar label Dec 28, 2022
tghosth added a commit that referenced this issue Jan 5, 2023
@tghosth tghosth linked a pull request Jan 5, 2023 that will close this issue
@tghosth tghosth added 6) PR awaiting review and removed 3) awaiting proposal There is some discussion in issue and reach to some results but it's not concluded with clear propos labels Jan 5, 2023
@tghosth tghosth removed their assignment Jan 5, 2023
@elarlang
Copy link
Collaborator

elarlang commented Jan 5, 2023

Proposed:
Verify that the application will not accept large files that could cause a denial of service when they are processed.

I would like to see there something like "Verify that the application will not accept larger files than it can process and not causing denial of service attack."

The point to add / scenario to cover: by proposed requirement text, if application gets an error but without causing dos attack, it could be still ok.

@tghosth
Copy link
Collaborator

tghosth commented Jan 8, 2023

How about:

Verify that the application will not accept files which are larger than it can process without causing a loss of performance or availability (denial of service attack).

Otherwise, I am not sure what you mean by " if application gets an error but without causing dos attack, it could be still ok"

@elarlang
Copy link
Collaborator

elarlang commented Jan 8, 2023

I mean - if you try to upload some large file, program code just crashes. Server in general is ok, crash is affecting only this one user. But this one user can not upload the file he/she wants. It's not denial of service for other users, we can maybe watch it as denial of service for this one user.

Maybe just move brackets:
Verify that the application will not accept files which are larger than it can process (e. g without causing a loss of performance or denial of service attack).

tghosth added a commit that referenced this issue Jan 9, 2023
@tghosth
Copy link
Collaborator

tghosth commented Jan 9, 2023

I mean - if you try to upload some large file, program code just crashes. Server in general is ok, crash is affecting only this one user. But this one user can not upload the file he/she wants. It's not denial of service for other users, we can maybe watch it as denial of service for this one user.

Maybe just move brackets: Verify that the application will not accept files which are larger than it can process (e. g without causing a loss of performance or denial of service attack).

I modified the PR #1514 on this basis

elarlang pushed a commit that referenced this issue Jan 9, 2023
elarlang pushed a commit that referenced this issue Jan 9, 2023
@elarlang
Copy link
Collaborator

elarlang commented Jan 9, 2023

I accepted and merged the PR, but reopened issue.

Do we want to reword it to "positive requirements" (what application should do) instead of "negative requirement" (what application should not do) like we have at the moment. If this is not needed, this issue can be closed.

@tghosth
Copy link
Collaborator

tghosth commented Jan 9, 2023

Great, point I opened #1519 which rewords it

elarlang pushed a commit that referenced this issue Jan 10, 2023
@elarlang
Copy link
Collaborator

update merged, close

@octo-reminder
Copy link

octo-reminder bot commented Jan 17, 2023

🔔 @tghosth

@tghosth to create a PR

tghosth added a commit that referenced this issue Apr 3, 2023
tghosth added a commit that referenced this issue Apr 3, 2023
tghosth added a commit that referenced this issue Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6) PR awaiting review _5.0 - prep This needs to be addressed to prepare 5.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants