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

[bugfix] Block creation of collection by guest #3505 #3899

Merged
merged 3 commits into from May 27, 2021

Conversation

dizzzz
Copy link
Member

@dizzzz dizzzz commented May 23, 2021

fixes #3505
added tests @joewiz

@dizzzz dizzzz marked this pull request as ready for review May 24, 2021 12:35
@adamretter
Copy link
Member

@dizzzz I think the fix looks good and is certainly on the right path. Would you be able to contribute a test for this please?

@dizzzz
Copy link
Member Author

dizzzz commented May 25, 2021

Would a Xquery based test be able to do the test?

@dizzzz dizzzz marked this pull request as draft May 25, 2021 19:17
@dizzzz dizzzz changed the title [bugfix] Attempt to fix #3505 [bugfix] Block creation of collection by guest #3505 May 25, 2021
@dizzzz dizzzz added bug issue confirmed as bug enhancement new features, suggestions, etc. high prio labels May 25, 2021
@dizzzz dizzzz marked this pull request as ready for review May 25, 2021 20:51
@dizzzz dizzzz added this to the eXist-5.3.0 milestone May 25, 2021
@sonarcloud
Copy link

sonarcloud bot commented May 25, 2021

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@adamretter
Copy link
Member

@dizzzz I am not certain, all the security tests so far are in Java.

@joewiz
Copy link
Member

joewiz commented May 25, 2021

In my testing, the guest:create-collection test in this PR shows that the PR prevents guest from performing the xmldb:create-collection operation. In develop (before this PR), the test fails (well, the first try passes since the exception is thrown, but the 2nd and subsequent executions of the same test fail because the collection was actually created in the 1st pass). The other tests included in this PR just exercise the other xmldb functions that guest should be prevented from using. They all passed before this PR and still pass with this PR.

@joewiz
Copy link
Member

joewiz commented May 26, 2021

17 successful and 3 failing - looking good!

Appveyor says:

[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ exist-index-range ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to C:\projects\exist\extensions\indexes\range\target\test-classes
[INFO] 
[INFO] Results:
[INFO] 
[ERROR] Errors: 
[ERROR] org.exist.xquery.modules.file.XmldbBinariesTest.readAndWriteBinary[remote]
[ERROR]   Run 1: XmldbBinariesTest>AbstractBinariesTest.setup:58->storeBinaryFile:74 � XMLDB Fa...
[ERROR]   Run 2: XmldbBinariesTest>AbstractBinariesTest.cleanup:63->removeCollection:121 � XMLDB
[INFO] 
[ERROR] org.exist.xquery.modules.file.XmldbBinariesTest.readBinary[remote]
[ERROR]   Run 1: XmldbBinariesTest>AbstractBinariesTest.setup:58->storeBinaryFile:74 � XMLDB Fa...
[ERROR]   Run 2: XmldbBinariesTest>AbstractBinariesTest.cleanup:63->removeCollection:121 � XMLDB

The other 2 failures were Java 11 (macOS latest) and 15 (ubuntu latest). The macOS failure looks like the dependency check random rate limit issue we discussed on community calls:

Error:  Failed to execute goal org.owasp:dependency-check-maven:6.1.6:check (default) on project exist-restxq: One or more exceptions occurred during dependency-check analysis: One or more exceptions occurred during analysis:
Error:  	AnalysisException: Failed to request component-reports
Error:  		caused by TransportException: Unexpected response; status: 429
Error:  -> [Help 1]
Error:  
Error:  To see the full stack trace of the errors, re-run Maven with the -e switch.
Error:  Re-run Maven using the -X switch to enable full debug logging.
Error:  
Error:  For more information about the errors and possible solutions, please read the following articles:
Error:  [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Error:  
Error:  After correcting the problems, you can resume the build with the command
Error:    mvn <args> -rf :exist-restxq
Error: Process completed with exit code 1.

As to the ubuntu issue, I can't really tell where the real error appears, so I won't paste anything in.

As to all 3, I can't judge their significance, I'm afraid...

@dizzzz
Copy link
Member Author

dizzzz commented May 27, 2021

rerunning Appveyor

@joewiz
Copy link
Member

joewiz commented May 27, 2021

@dizzzz AppVeyor is green! We just need an approval from a member of @eXist-db/core.

@joewiz joewiz requested a review from a team May 27, 2021 21:06
Copy link
Member

@line-o line-o left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very cool! Great work @dizzzz

@line-o line-o merged commit 06a77f0 into eXist-db:develop May 27, 2021
@dizzzz dizzzz deleted the bugfix/guest_collection_3505 branch May 28, 2021 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issue confirmed as bug enhancement new features, suggestions, etc. high prio
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Guest users can create collections hidden from dba users
5 participants