🗡 Molag is a POC/awareness project for dependency risks.

molag

// 🚧 WIP

Intro

This is a POC package, showcasing why dependencies in general (in any programming language/framework) are a bad idea.

This does not mean you should not use any dependencies, instead you must be aware of the attack vector.

This projects aims to raise awareness of the problem, how to avoid 'dependency hell' and how to better work with dependencies.

Why?

When you use a dependency, you are trusting the author/s (in some cases this can be 100s of contributors).

Some changes to the dependency can be malicious or incompetence, but both can result in a vulnerability.

When using a dependency, you are also trusting the processes, practices and security of the project and its maintainers.

Credentials can be leaked, and unauthorized actors can gain access to the project.

When using a dependency, you are also trusting their dependencies.

This can easily lead to a dependency hell of great proportions.

When using a dependency, (in some languages/frameworks) you are also trusting the build process.

Certain vulnerabilities or problems can be introduced during the build process. Halting CI/CD pipelines, development, etc.

When importing a dependency, it is not necessary to call a function in order to expose yourself to malicious code.

As showcased in this package, languages often allow for init() type functions to be called at import time.

When importing a dependency, (in some languages/frameworks) you are exposing your code state/data to the dependency.

Certain languages/frameworks allow for shared objects (data, state, ...). If both your code and a malicious dependency have access to the same data/state, the malicious code can modify it.

As showcased in this package, Go offers a default http.Client and some helper functions such as http.Get which make use of the default http.Client. It is dangerous and irresponsible to use the default http.Client as it can be modified and configured by single line of code in all your dependencies.

As such, when working with global defaults, it's best to create your own local private default instance.

In the case of Go, for example, you should also be aware of nested defaults. In the http.Client example, it would not be enough to create your client as var myClient := &http.Client{}, as this still uses the other defaults, such as Transport. Instead, you must initialize all fields and sub-fields.s

Incidents

This is not a comprehensive list of incidents.

Solutions

For using dependencies

  • Fork. Make a copy of the code under your control.
    • For some dependencies, you might even want to fork, and remove any unused code and dependencies.
  • Use checksums, lock files, or any means provided to you by the language/framework.
  • Reviews and processes
    • Review the dependency code, owners, and maintainers.
    • Review your business and project attack vectors.
    • Review how critical the dependency becomes for your project and calculate the risk.
    • Have mitigation strategies in place.
    • Have review processes in place.
  • Avoid using shared resources.

For releasing packages

  • Avoid using dependencies.
    • If the code you need is a small part of a bigger project, copy over the code, license, etc, and use it.
    • If the code you need is a large part of a bigger project, fork the project, and remove the code you don't need.
    • If the code you need is trivial, implement it yourself.
    • Less is more.
  • Consider splitting your code into smaller usable packages.
  • Ensure credentials' security.
  • Review your business and project attack vectors.
  • Avoid using shared resources.

Responsibility

When using a dependency, and releasing a package/software, you are responsible for the actions of each and every byte that gets executed. You are also responsible for reviewing the licenses and legal obligations of the dependencies.

Owner
SUDOLESS
Sustainable Tech Solutions
SUDOLESS
Similar Resources

Go poc - Golang proof of concept

quickstart tar -zxvf go1.17.6.linux-amd64.tar.gz -C ~/tools/ echo "export PATH=

Jan 8, 2022

Vishnu - Golang port-knocking PoC

Vishnu(The Hidden Backdoor) Taken from the Trimurit, the triple deity of supreme

Nov 9, 2022

SandboxPPL - Golang PoC that sandboxes Defender (or other PPL) by setting its token integrity to Untrusted

SandboxPPL - Golang PoC that sandboxes Defender (or other PPL) by setting its token integrity to Untrusted

SandboxPPL Golang PoC that sandboxes Defender (or other PPL) by setting its toke

Jul 1, 2022

PHP functions implementation to Golang. This package is for the Go beginners who have developed PHP code before. You can use PHP like functions in your app, module etc. when you add this module to your project.

PHP Functions for Golang - phpfuncs PHP functions implementation to Golang. This package is for the Go beginners who have developed PHP code before. Y

Dec 30, 2022

This project used to learn golang and try to bypass AV

This project used to learn golang and try to bypass AV

sucksAV This project used to learn golang and try to bypass AV 描述 基于Golang开发的BypassAV,采取的shellcode分离技术,将shellcode注入到图片中,通过加载器进行加载,使用Golang动态加载技术 需要使用第

Nov 19, 2022

its a simple backdoor service that im making cuz i think that it could be cool its not finished but this is a cool project

  its a simple backdoor service that im making cuz i think that it could be cool its not finished but this is a cool project

yackdoor its a simple backdoor service that im making cuz i think that it could be cool its not finished but this is a cool project how it looks backd

Aug 18, 2022

Example mini project golang scanner application

Example mini project golang scanner application

Golang Scanner Contoh pembuatan aplikasi Java menggunakan BlueJ cek disini, tetapi berikut ini adalah versi rebuild dari Java ke Golang, dengan menggu

Nov 19, 2022

🔎 Help find Trojan Source vulnerability in code 👀 . Useful for code review in project with multiple collaborators

TrojanSourceFinder TrojanSourceFinder helps developers detect "Trojan Source" vulnerability in source code. Trojan Source vulnerability allows an atta

Nov 9, 2022

Go-sec-code is a project for learning Go vulnerability code.

Go-sec-code is a  project for learning Go vulnerability code.

Welcome to go-sec-code 👋 Go-sec-code is a project for learning Go vulnerability code. 🏠 Homepage Introduction 用beego作为后端框架开发的go语言靶场,目前已经完成 commandIn

Nov 23, 2022
Related tags
Poc-cve-2021-4034 - PoC for CVE-2021-4034 dubbed pwnkit

poc-cve-2021-4034 PoC for CVE-2021-4034 dubbed pwnkit Compile exploit.go go buil

Nov 9, 2022
Pokes users on Slack about outstanding risks found by Crowdstrike Spotlight or vmware Workspace ONE so they can secure their own endpoint.
Pokes users on Slack about outstanding risks found by Crowdstrike Spotlight or vmware Workspace ONE so they can secure their own endpoint.

?? security-slacker Pokes users on Slack about outstanding risks found by Crowdstrike Spotlight or vmware Workspace ONE so they can secure their own e

Nov 29, 2022
一款完善的安全评估工具,支持常见 web 安全问题扫描和自定义 poc | 使用之前务必先阅读文档
一款完善的安全评估工具,支持常见 web 安全问题扫描和自定义 poc | 使用之前务必先阅读文档

Welcome to xray ?? 一款功能强大的安全评估工具 ✨ Demo ?? 使用文档 ⬇️ 下载地址 注意:xray 不开源,直接下载构建的二进制文件即可,仓库内主要为社区贡献的 poc,每次 xray 发布将自动打包。 ?? 快速使用 在使用之前,请务必阅读并同意 License 文件中

Jan 5, 2023
PoC for running AWS services(kinesis, dynamodb, lambdas) locally with Localstack

hotdog-localstack-PoC PoC for running AWS services(kinesis, dynamodb, lambdas) locally with Localstack alias awslocal="aws --endpoint-url=http://local

Dec 3, 2022
ZipExec is a Proof-of-Concept (POC) tool to wrap binary-based tools into a password-protected zip file.
ZipExec is a Proof-of-Concept (POC) tool to wrap binary-based tools into a password-protected zip file.

ZipExec ZipExec is a Proof-of-Concept (POC) tool to wrap binary-based tools into a password-protected zip file. This zip file is then base64 encoded i

Dec 31, 2022
An improvement on the PoC for the privacy-preserving contact discovery scheme I implemented as part of my UCL masters degree

Privacy-Preserving Contact Discovery / ARKE - PoC This is an improved version of the work I submitted as part of my masters degree dissertation at UCL

Dec 18, 2021
PoC for CVE-2015-1635 / MS15-034 - HTTP.sys Allows Remote Code Execution / Check & DOS
PoC for CVE-2015-1635 / MS15-034 - HTTP.sys Allows Remote Code Execution / Check & DOS

CVE-2015-1635 PoC for CVE-2015-1635 / MS15-034 - HTTP.sys Allows Remote Code Execution / Check & DOS ./MS15-034 <URL> <RESOURCE> <FLAG [0 or 18]> Note

Nov 3, 2021
A CVE-2021-22205 Gitlab RCE POC written in Golang

Golang-CVE-2021-22205-POC A bare bones CVE-2021-22205 Gitlab RCE POC written in Golang which affects Gitlab CE/EE < 13.10.3 Gitlab CE/EE < 13.9.6 Gitl

Jul 4, 2022
PoC for CVE-2021-41277

CVE-2021-41277 PoC Metabase is an open source data analytics platform. Local File Inclusion issue has been discovered in some versions of metabase. He

Dec 3, 2021
Gocrypter - Crypter em golang (POC)
Gocrypter - Crypter em golang (POC)

Gocrypter Crypter em golang (POC) Uso ./gocrypter <executável> Estágios do crypter Comprimi o arquivo malicioso usando a ZLIB Criptografa os bytes res

Jan 2, 2022