Skip to content

Forgotten auth oracle #1243

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 20 commits into
base: master
Choose a base branch
from
Open

Forgotten auth oracle #1243

wants to merge 20 commits into from

Conversation

omursahin
Copy link
Collaborator

No description provided.

@omursahin omursahin requested a review from arcuri82 May 13, 2025 14:37
* GET /resources/42/ AUTH1 -> 200
*/
private fun handleForbiddenAuthentication(){
actionDefinitions.forEach { op ->
Copy link
Collaborator

Choose a reason for hiding this comment

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

this algorithm needs to be updated and matching what described in notes.txt. i made an update there to clarify things

}

// if the same path has authenticated and unauthenticated success requests
if(checkAnyAuth.isNotEmpty() && a200WithoutAuth.isNotEmpty()){
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm not sure if this will cause any problems.

Copy link
Collaborator

Choose a reason for hiding this comment

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

why this check? doesn't seem correct. you could have an open endpoint where you get a 200 with and without auth. actually, you might want to explicitely have such a case in the E2E, to make sure it is not wrongly labelled as a bug

val candidates = RestIndividualSelectorUtils.findIndividuals(
individualsInSolution,
op.verb,
op.path,
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

When the verb is PUT/POST, there is only one request left in here.
For example;
PUT /request 201 Auth -> FOO
GET /request 200 Auth -> FOO
Then only:
PUT /request 201 Auth -> FOO remains. Here, when FOO is replaced with NoAuth;
PUT /request 201 Auth -> NOAUTH becomes. There is no point in sending this request alone. I need to do something for such cases.

Copy link
Collaborator

Choose a reason for hiding this comment

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

sorry, not sure i follow this discussion

@omursahin omursahin requested a review from arcuri82 May 19, 2025 21:20
it.auth !is NoAuth
}

// if the same path has authenticated and unauthenticated success requests
Copy link
Collaborator

Choose a reason for hiding this comment

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

should be endpoint, not path

}

// if the same path has authenticated and unauthenticated success requests
if(checkAnyAuth.isNotEmpty() && a200WithoutAuth.isNotEmpty()){
Copy link
Collaborator

Choose a reason for hiding this comment

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

why this check? doesn't seem correct. you could have an open endpoint where you get a 200 with and without auth. actually, you might want to explicitely have such a case in the E2E, to make sure it is not wrongly labelled as a bug

individualsInSolution,
op.verb,
op.path,
statusGroup = StatusGroup.G_4xx,
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is not correct. it would pick any in 4xx, like 400 and 404

individualsInSolution,
op.verb,
op.path,
statusGroup = StatusGroup.G_2xx
Copy link
Collaborator

Choose a reason for hiding this comment

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

the auth check could be done here, there is parameter for it

val candidates = RestIndividualSelectorUtils.findIndividuals(
individualsInSolution,
op.verb,
op.path,
Copy link
Collaborator

Choose a reason for hiding this comment

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

sorry, not sure i follow this discussion

)
finalIndividual.seeMainExecutableActions().last().auth = HttpWsNoAuth()

finalIndividual.seeMainExecutableActions()
Copy link
Collaborator

Choose a reason for hiding this comment

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

not following this... let's discuss it in our meeting

actionResults: List<ActionResult>,
fv: FitnessValue
) {
val getPaths = individual.seeMainExecutableActions()
Copy link
Collaborator

Choose a reason for hiding this comment

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

should be on the endpoints, not paths. you can get it with the getName, which for REST actions is the endpoint

val a = individual.seeMainExecutableActions()[index]
val r = actionResults.find { it.sourceLocalId == a.getLocalId() } as RestCallResult

if(a.auth is NoAuth && faultyPaths.contains(a.path) && r.getStatusCode() == 200){
Copy link
Collaborator

Choose a reason for hiding this comment

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

endpoints

Copy link
Collaborator

Choose a reason for hiding this comment

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

why 200? any in the 2xx family would do. can use checks in StatusGroup


if(a.auth is NoAuth && faultyPaths.contains(a.path) && r.getStatusCode() == 200){
val scenarioId = idMapper.handleLocalTarget(
idMapper.getFaultDescriptiveId(FaultCategory.SECURITY_FORGOTTEN_AUTHENTICATION, a.getName())
Copy link
Collaborator

Choose a reason for hiding this comment

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

yep, here the a.getName() is the endpoint VERB:PATH

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.

2 participants