Giter Club home page Giter Club logo

Comments (3)

s3-odara avatar s3-odara commented on August 17, 2024

Rustの正規表現って後方参照とか先読みのない素朴な正規表現なんだけど、潜在的に危険な機能の制限のおかげで線形時間での実行が保証されてるらしい(=redos攻撃の可能性がない?)

https://gihyo.jp/dev/serial/01/perl-hackers-hub/007402
https://medium.com/veltra-engineering/regexp-library-re2-for-fragility-risk-7c28310838e0

C++の安全な正規表現の実装がnode.isにも移植されてるらしいから、今ある正規表現をそれに変換するのが根本的な解決策になるかもしれない

from butler.

ver-1000000 avatar ver-1000000 commented on August 17, 2024

ほえー
ということは「既存の安全な正規表現の手法がある」ということなので、
その観点でいうと「なんかいい感じの安全正規表現ライブラリを探して使う」ってアプローチ取れそう。

from butler.

s3-odara avatar s3-odara commented on August 17, 2024

Discordは最近デフォルトの荒らし対策みたいなやつが導入されて、ユーザーが正規表現書けるようになったんだけどそれはrustの正規表現使うのと、コンパイルサイズ制限で安全にしてる

でも安全な正規表現を使うなら、マッチリスト/マッチさせないリストの両方を用意するのと、それぞれ複数の正規表現を入れられるようにしないと表現力が落ちる。

from butler.

Related Issues (20)

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.