Giter Site home page Giter Site logo

i-love-flamingo / pugtemplate Goto Github PK

View Code? Open in Web Editor NEW
7.0 15.0 1.0 432 KB

A Pug Template engine for Flamingo

License: MIT License

Go 99.03% Makefile 0.01% Perl 0.80% Pug 0.16%
flamingo-module golang hacktoberfest pug-template-engine template-engine

pugtemplate's Issues

dependencies: fix vunlerability

Hello friends,
when running Nancy on pugtemplate it detects a vulnerable dependency.

Approach
I am on pugtemplate master and execute:

go list -json -m all | docker run --rm -i sonatypecommunity/nancy:latest sleuth

Output

Checking for updates...
Already up-to-date.
pkg:golang/golang.org/x/[email protected]
1 known vulnerabilities affecting installed version
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ [CVE-2019-11840]  Use of Insufficiently Random Values                                                                                                                                                                       ┃
┣━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
┃ Description        ┃ An issue was discovered in supplementary Go cryptography libraries, aka                                                                                                                                ┃
┃                    ┃ golang-googlecode-go-crypto, before 2019-03-20. A flaw was found in the                                                                                                                                ┃
┃                    ┃ amd64 implementation of golang.org/x/crypto/salsa20 and                                                                                                                                                ┃
┃                    ┃ golang.org/x/crypto/salsa20/salsa. If more than 256 GiB of keystream is                                                                                                                                ┃
┃                    ┃ generated, or if the counter otherwise grows greater than 32 bits, the                                                                                                                                 ┃
┃                    ┃ amd64 implementation will first generate incorrect output, and then cycle                                                                                                                              ┃
┃                    ┃ back to previously generated keystream. Repeated keystream bytes can lead                                                                                                                              ┃
┃                    ┃ to loss of confidentiality in encryption applications, or to predictability                                                                                                                            ┃
┃                    ┃ in CSPRNG applications.                                                                                                                                                                                ┃
┣━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
┃ OSS Index ID       ┃ 5121f5ff-9831-44a6-af2e-24f7301d1df7                                                                                                                                                                   ┃
┣━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
┃ CVSS Score         ┃ 5.9/10 (Medium)                                                                                                                                                                                        ┃
┣━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
┃ CVSS Vector        ┃ CVSS:3.0/AV:N/AC:H/PR:N/UI:N/S:U/C:H/I:N/A:N                                                                                                                                                           ┃
┣━━━━━━━━━━━━━━━━━━━━╋━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┫
┃ Link for more info ┃ https://ossindex.sonatype.org/vuln/5121f5ff-9831-44a6-af2e-24f7301d1df7?component-type=golang&component-name=golang.org%2Fx%2Fcrypto&utm_source=nancy-client&utm_medium=integration&utm_content=1.0.15 ┃
┗━━━━━━━━━━━━━━━━━━━━┻━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛

1 Vulnerable Packages

┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Summary                       ┃
┣━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━┫
┃ Audited Dependencies    ┃ 103 ┃
┣━━━━━━━━━━━━━━━━━━━━━━━━━╋━━━━━┫
┃ Vulnerable Dependencies ┃ 1   ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━┻━━━━━┛

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/main.yml
  • actions/checkout v4
  • actions/setup-go v5
  • actions/checkout v4
  • actions/setup-go v5
.github/workflows/semanticore.yml
  • actions/checkout v4
  • actions/setup-go v5
gomod
go.mod
  • go 1.21
  • go 1.21.6
  • flamingo.me/dingo v0.2.10
  • flamingo.me/flamingo/v3 v3.8.1
  • github.com/go-sourcemap/sourcemap v2.1.3+incompatible
  • github.com/go-test/deep v1.1.0
  • github.com/pkg/errors v0.9.1
  • github.com/spf13/cobra v1.8.0
  • github.com/stretchr/testify v1.9.0
  • go.uber.org/goleak v1.3.0
  • golang.org/x/net v0.23.0
  • golang.org/x/sync v0.7.0
npm
example/frontend/package.json
  • flamingo-carotene-core ^8.0.0
  • flamingo-carotene-pug ^8.0.0

  • Check this box to trigger a request for Renovate to run again on this repository

Problem of scoping in loops

In an each loop, the scoping of variables is not really handled. If a variable is declared in one iteration of the loop, it's value is kept in the following iterations

In the following example, the variable newVariable will be set to test from the beginning until the end of the loop iteration

- var array = [1,2,3,4]
each value, index in array
  if index === 0
    - var newVariable = 'test'

Is this a known issue?

Pushing numbers to array fails

It is not possible to push numbers to an array. If we do so:

- var min = 1
- var max = 99
- var i = min
- var array = []
while i < max
 - array.push(i)
 - i++

We get the following error

executing "mixin_cart" at <$n>: wrong type for value; expected pugjs.Object; got int

This is of because Array.Push only takes an object as parameter, and those initialized numbers aren't really of pugjs.Object type at that time.

However if we have something like the following

- var object = {
 min: 1,
 max: 99
}
- var i = object.min
- var array = []
while i < object.max
 - array.push(i)
 - i++

It would work perfectly, because the type of object.min assigned to i, is a valid Object.

False boolean in attribute overwrites values

We discovered that falsy booleans are interpreted quite weirdly by the compiler. When writing something like the following:

- var classVariable = false
.className(class=classVariable)

One could expect to keep the className class in the rendered HTML afterwards, indeed there are snippets of code that intend to do that (runtime.go line 149 to 155). But in effect this div won't receive any classes.

is:
<div></div>
instead of:
<div class="className"></div>

Because of all the reflections in this place I couldn't really find what was going on.

First of all what is the behaviour should we expect for attributes with values that are either false or null? If the expected behaviour I described above is the correct one, what would be the best way to keep track of the various ways of attaching attributes or to have falsy booleans not be reflected as "no attribute" in HTML?

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.