Skip to content

Dangerous example #76

Description

@bitdivine

The example server.js:

var staticHandler = function(request, response) {
  var path = request.url;

  fs.readFile(__dirname + path, function(err, content) {

doesn't validate the url, so there is nothing stopping it from being e.g. /../spec/server.key (given a few lines later). Given that people are likely to copy the example, setting a safe precedent might be a good idea! :-)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions