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

[LOTP] Add webpack #30

Open
allanlw opened this issue Apr 17, 2024 · 0 comments
Open

[LOTP] Add webpack #30

allanlw opened this issue Apr 17, 2024 · 0 comments
Labels
good first issue Good for newcomers idea

Comments

@allanlw
Copy link

allanlw commented Apr 17, 2024

Description of the LOTP tool

webpack is used for bundling javascript.

Files

Webpack will load configuration files in Javascript format of course (e.g. webpack.config.js)

What is less well known is that the webpack magic comments feature lets you execute code during compile time by adding comments to Javascript files.

Documentation

It has a note in the documentation saying

Do not compile untrusted code with webpack. It could lead to execution of malicious code on your computer, remote servers, or in the Web browsers of the end users of your application.

Config Files: https://webpack.js.org/configuration/

Magic Comments: https://webpack.js.org/api/module-methods/#magic-comments

Real-world example

https://gist.github.com/allanlw/9df6a260d689500c7e25cb9a56bdd54d I've verified it works on Webpack 5.91 (the current stable).

Additional notes

I would appreciate a credit if this is integrated, as I believe I discovered it (the note in the docs was added after I reported it on July 12th, 2020)

@allanlw allanlw added the idea label Apr 17, 2024
@fproulx-boostsecurity fproulx-boostsecurity added the good first issue Good for newcomers label Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers idea
Projects
None yet
Development

No branches or pull requests

2 participants