GithubHelp home page GithubHelp logo

sampmailjs's Introduction

SAMPMailJS

sampctl

Installation

Simply install to your project:

sampctl package install Fairuz-Afdhal/SAMPMailJS

Include in your code and begin using the library:

#include <SAMPMailJS>

Usage

SendEmail(name[], to[], subject[], text[], bool:isTemplate = false, templateName[] = "default.html")
 name: The name that will appear next to your email (string)
 to: The email address you want to send the email to (string)
 subject: The subject of your email (string)
 isTemplate: When set to false, it will only send the text you input in the argument text. When set to true, it will try to use a template. (boolean)
 templateName: The file name of the template that must be in the same folder of your NodeJS script. (string)

Testing

To test, simply run the package:

sampctl package run

sampmailjs's People

Contributors

diogomartino avatar johnmagdy avatar fairuz-afdhal avatar dependabot[bot] avatar

Stargazers

 avatar Nazar Kornienko avatar Tractus Corticospinalis avatar Dayvison avatar rhudsu avatar Chainksain avatar  avatar Carl You avatar John Magdy Lotfy Kamel avatar

Watchers

 avatar John Magdy Lotfy Kamel avatar rhudsu avatar

sampmailjs's Issues

Major security issue: password check is faulty

The password check that is supposed to return a HTTP 403 Forbidden is faulty and creates a major security hole since it allows anyone to supply an empty password parameter (or omit the parameter entirely), allowing them to send illicit mails from the server.

SAMPMailJS/sampmail.js

Lines 54 to 57 in 381de7b

if (urlObj['query']['pw'] != config.httpPassword && urlObj['query']['pw'] != 'undefined' && urlObj['query']['pw'] != '' && urlObj['query']['pw'] != null) {
logResponse(req.connection.remoteAddress, 403, 'Wrong password', res);
return;
}

Reproduction in browser console:

Password param supplied, but empty:

config = { httpPassword: "abc123" }
urlObj = { query: { pw: "" }}

urlObj['query']['pw'] != config.httpPassword && urlObj['query']['pw'] != 'undefined' && urlObj['query']['pw'] != '' && urlObj['query']['pw'] != null

Result:

false

When it should be true to send the 403 Forbidden.

afbeelding

Password param not supplied:

config = { httpPassword: "abc123" }
urlObj = { query: {}}

urlObj['query']['pw'] != config.httpPassword && urlObj['query']['pw'] != 'undefined' && urlObj['query']['pw'] != '' && urlObj['query']['pw'] != null

Result:

false

When, again, it should be true to send the 403 Forbidden.

afbeelding

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.