Skip to content

data/bypassing-stack-protector: Fix canary overwrite#208

Open
XXMA16 wants to merge 1 commit into
cs-pub-ro:mainfrom
XXMA16:lab-4-stack-protector-bypass-fix
Open

data/bypassing-stack-protector: Fix canary overwrite#208
XXMA16 wants to merge 1 commit into
cs-pub-ro:mainfrom
XXMA16:lab-4-stack-protector-bypass-fix

Conversation

@XXMA16

@XXMA16 XXMA16 commented Nov 10, 2025

Copy link
Copy Markdown

Prerequisite Checklist

  • Read the contribution guidelines regarding submitting new changes to the project;
  • Tested your changes against relevant architectures and platforms;
  • Updated relevant documentation (if needed).

Description of changes

The canary and return address overwrites were done two frames higher (instead of only one).

An explicit statement that the canary overwrite should be commented out before proceeding with replacing the return address with &pawned has also been added.

Explanation

addr points to [RBP-16], since at [RBP-8] resides the canary, meaning that addr[1] will overwrite it. The return address is found two machine words higher than that, at [RBP+8]

@teodutu teodutu added the student-contrib Fix or improvement made by a student label Jan 12, 2026
@XXMA16 XXMA16 force-pushed the lab-4-stack-protector-bypass-fix branch 2 times, most recently from 50ed10d to 0f696ed Compare April 6, 2026 12:59
Solution now suggests overwriting the canary of
the current stack frame instead of 2 up

Signed-off-by: Mihnea Gheorghe <mihnea.gheorghe1610@stud.acs.upb.ro>
@XXMA16 XXMA16 force-pushed the lab-4-stack-protector-bypass-fix branch from 0f696ed to 38f3573 Compare April 6, 2026 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

student-contrib Fix or improvement made by a student

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants