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

Create CVE-2024-49770 #11474

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

KoYejune0302
Copy link
Contributor

Template / PR Information

`oak` is a middleware framework for Deno's native HTTP server, Deno Deploy, Node.js 16.5 and later, Cloudflare Workers and Bun. By default `oak` does not allow transferring of hidden files with `Context.send` API. However, prior to version 17.1.3, this can be bypassed by encoding `/` as its URL encoded form `%2F`. For an attacker this has potential to read sensitive user data or to gain access to server secrets. Version 17.1.3 fixes the issue.

Template Validation

I've validated this template locally?

  • YES
  • NO

Additional Details (leave it blank if not applicable)

Additional References:

@ertygiq
Copy link

ertygiq commented Jan 12, 2025

@KoYejune0302 why 'temp' directory?

@KoYejune0302
Copy link
Contributor Author

@ertygiq
This vulnerability occurs when using the Oak library, where if the hidden option is set to false, hidden files become visible when paths are crafted using "%2F".

This is the server.ts I used to test locally

// server.ts

import { Application } from "jsr:@oak/[email protected]";

const app = new Application();

app.use(async (context, next) => {
  try {
    await context.send({
      root: './root',
      hidden: false, // default
    });
  } catch {
    await next();
  }
});

await app.listen({ port: 8000 });

@GeorginaReeder
Copy link

Thanks for your contribution @KoYejune0302 ! :)

@DhiyaneshGeek DhiyaneshGeek self-assigned this Jan 15, 2025
@DhiyaneshGeek DhiyaneshGeek added the Done Ready to merge label Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Done Ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants