{"id":13452993,"url":"https://github.com/jklmnn/imagejs","last_synced_at":"2025-04-04T06:06:26.538Z","repository":{"id":23003418,"uuid":"26354078","full_name":"jklmnn/imagejs","owner":"jklmnn","description":"Small tool to package javascript into a valid image file.","archived":false,"fork":false,"pushed_at":"2022-06-11T19:19:01.000Z","size":50,"stargazers_count":903,"open_issues_count":0,"forks_count":118,"subscribers_count":35,"default_branch":"master","last_synced_at":"2025-03-28T05:08:30.324Z","etag":null,"topics":["injection","xss"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jklmnn.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-11-08T08:06:59.000Z","updated_at":"2025-02-20T14:34:09.000Z","dependencies_parsed_at":"2022-07-12T06:16:13.152Z","dependency_job_id":null,"html_url":"https://github.com/jklmnn/imagejs","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jklmnn%2Fimagejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jklmnn%2Fimagejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jklmnn%2Fimagejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jklmnn%2Fimagejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jklmnn","download_url":"https://codeload.github.com/jklmnn/imagejs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247128741,"owners_count":20888234,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["injection","xss"],"created_at":"2024-07-31T08:00:30.263Z","updated_at":"2025-04-04T06:06:26.523Z","avatar_url":"https://github.com/jklmnn.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"imagejs\n=======\n\nSmall tool to package javascript into a valid image file.  \nCurrently supported are gif and bmp.\n\n### Disclaimer\n\nThis program is just a proof of concept example. It may contain bugs and it is\nonly tested with valid inputs. Do NOT pass untrusted data to this program.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,\nINCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR\nPURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM,\nDAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,\nARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS\nIN THE SOFTWARE.\n\n### Building\n\nTo build this tool, `build-essential` and `cmake` are required (this is for Debian and Ubuntu based systems, for any other system please refer to its documentation).\nAfter installing the dependencies, run the following commands:\n\n```\n$ git clone https://github.com/jklmnn/imagejs.git\n$ cd imagejs\n$ mkdir build\n$ cd build\n$ cmake ..\n$ make\n```\n\n### Usage\n\nRun `imagejs option jsfile.js`.\nThe outcoming image file will be named like the input file + the image ending..\nOptions are currently `bmp`, `gif`, `webp`, `pnm` and `pgf`.\n\nIf you add `-l` as flag you your image is written to the file so that you can open it and view your code as a line of pixels.  \nThis is currently only supported for bmp files.\n\n### Example\n\n`$ ./imagejs bmp code.js -l`  \nwill return a file named code.js.bmp that is viewable.\n\nCode can now be embedded into existing gif files by using the flag `-i` with a gif file as argument.  \nExample:  \n`$ ./imagejs gif code.js -i giffile.gif`\n\nThis is currently available for gif, bmp, webp, where webp is still beta.\n\nSupported output files are: `gif`, `bmp`, `webp`, `pnm`, `pgf`  \n\nBackground:\n-----------\n\nThis tool allows you to create a picture file that is able to run javascript code.\nA file like this is able to extend XSS vulnerabilities. For example, if you are able to put a script tag on a website but cant run the script because it only runs scripts from this website, you can just upload e.g. a profile picture containing the code you want to run.\nThe idea came from [Ajin Abraham](http://iamajin.blogspot.in/2014/11/when-gifs-serve-javascript.html) and I put it in C code and also added the ability to do the same thing also with bitmap files.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjklmnn%2Fimagejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjklmnn%2Fimagejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjklmnn%2Fimagejs/lists"}