SaaS
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
Description
Author's murmur warning! u can jump to Overview.
- The challenge is inspired from fastify document
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
- The official doesn't support dynamic creation of schema validation by default, and fastify only precompile schema validation once when the server startup.
- I try to find the real use case or plugin that support dynamic schema/route creation, and the official doesn't like this proposal. see https://github.com/fastify/help/issues/149
- The package
fast-json-stringify
is used to create validator. Thus, I try to find any dependents which has any use case that creates validator from untrusted user input, and 404 not found.
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
- Also, document mentions this security notice
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
- But it is CTF,impractialty is ok, right? And deadline is approaching… That's make it a service to create dynamic schema!
- An additional part is nginx. Since ginoah estimated about 50~100 solves (
easy+++++++
), i comed up with it when i was reading document for solving ginoah's 1linenginx.
- Then ginoah and kaibro solved this part as soon as they read it. Only i learned it in 2023.
- Thus, the final difficulty is
easy++++++
.
Overview
- The challenge is clear, try to find where we can inject code in something like
new Function(...)
when create custom schema validator.
- and we have to route request to
server_name
like *.saas
but with HTTP header set to Host: easy++++++
Solution
Nginx
- Nginx part is trivial, from document
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
- Nginx match
server_name
with $host
, and it can be set by request line
. Then below request bypass the check.
fast-json-stringify
- open vscode, start debugger, trace code.
- I found
requiredProperty
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →
Image Not Showing
Possible Reasons
- The image was uploaded to a note which you don't have access to
- The note which the image was originally uploaded to has been deleted
Learn More →